Skip to main content
Version: Next

Task 02: Configure Azure Monitor Agent

Runbook Azure

DOCUMENT CATEGORY: Runbook SCOPE: Azure Monitor Agent deployment and DCR configuration PURPOSE: Deploy AMA to cluster nodes and configure data collection MASTER REFERENCE: Microsoft Learn - Azure Monitor Agent

Status: Active


The Azure Monitor Agent (AMA) is the modern, unified agent for collecting monitoring data from Azure Local cluster nodes. It replaces the legacy Log Analytics agent and provides enhanced security, performance, and data collection capabilities through Data Collection Rules (DCRs).

Prerequisites

RequirementDescriptionValidation
Log Analytics WorkspaceCreated in Step 1Workspace ID available
Arc-Enabled ServersCluster nodes registered with Azure Arcaz connectedmachine list
Data Collection EndpointDCE created in Step 1DCE resource ID available
RBAC PermissionsMonitoring Contributor on resource groupRole assignment verified
Network ConnectivityOutbound 443 to Azure Monitor endpointsFirewall rules verified

Variables from variables.yml

VariableConfig PathExample
AZURE_SUBSCRIPTION_IDazure.subscription.id00000000-0000-0000-0000-000000000000
AZURE_SUBSCRIPTION_NAMEazure.subscription.nameAzure Local Production
AZURE_RESOURCE_GROUPazure.resource_group.namerg-azurelocal-prod-eus2
AZURE_REGIONazure.resource_group.locationeastus2
LOG_ANALYTICS_WORKSPACE_NAMEmonitoring.log_analytics.workspace_namelaw-azl-DAL-prod-01
SITE_CODEsite.codeDAL
CLUSTER_NODE_01_NAMEnodes[0].nameazl-dal-node-01
CLUSTER_NODE_02_NAMEnodes[1].nameazl-dal-node-02
CLUSTER_NODE_03_NAMEnodes[2].nameazl-dal-node-03
CLUSTER_NODE_04_NAMEnodes[3].nameazl-dal-node-04

Overview

flowchart TB
subgraph "Azure Local Cluster"
A[Node 1<br/>AMA Extension]
B[Node 2<br/>AMA Extension]
C[Node 3<br/>AMA Extension]
D[Node 4<br/>AMA Extension]
end

subgraph "Azure"
E[Data Collection Endpoint]
F[Data Collection Rule]
G[Log Analytics Workspace]
end

A --> E
B --> E
C --> E
D --> E
E --> F --> G

Configuration Options

Step 2.1: Install AMA Extension on Cluster Nodes

  1. Navigate to Azure PortalAzure ArcServers
  2. Select each cluster node (e.g., {{CLUSTER_NODE_01_NAME}})
  3. Go to SettingsExtensions
  4. Click + Add → Search for Azure Monitor Agent
  5. Click Create and configure:
SettingValue
Subscription{{AZURE_SUBSCRIPTION_NAME}}
Resource Group{{AZURE_RESOURCE_GROUP}}
  1. Repeat for all cluster nodes

Tip: When you enable HCI Insights (Step 3), AMA is automatically installed on all cluster nodes.

Step 2.2: Create Data Collection Rule

  1. Navigate to Azure MonitorData Collection Rules
  2. Click + Create
  3. Configure Basics:
SettingValue
Rule Namedcr-azl-{{SITE_CODE}}-performance
Subscription{{AZURE_SUBSCRIPTION_NAME}}
Resource Group{{AZURE_RESOURCE_GROUP}}
Region{{AZURE_REGION}}
Platform TypeWindows
Data Collection Endpointdce-{{SITE_CODE}}-azl-01
  1. Configure Resources — Add all cluster nodes as Arc-enabled servers
  2. Configure Collect and deliver:

Data Source 1: Performance Counters

  • Type: Performance Counters
  • Select counters for HCI Insights compatibility

Data Source 2: Windows Event Logs

  • Type: Windows Event Logs
  • Add: Microsoft-Windows-Health/Operational, Microsoft-Windows-SDDC-Management/Operational
  1. Configure Destination:
  • Destination Type: Azure Monitor Logs
  • Subscription: {{AZURE_SUBSCRIPTION_NAME}}
  • Log Analytics Workspace: {{LOG_ANALYTICS_WORKSPACE_NAME}}
  1. Click Review + CreateCreate

Associate DCR with Cluster Nodes

After creating the DCR, associate it with each cluster node:

# Associate DCR with each Arc-enabled server
$dcrResourceId = "/subscriptions/{{AZURE_SUBSCRIPTION_ID}}/resourceGroups/{{AZURE_RESOURCE_GROUP}}/providers/Microsoft.Insights/dataCollectionRules/dcr-azl-{{SITE_CODE}}-performance"

foreach ($node in $ClusterNodes) {
$arcServer = Get-AzConnectedMachine -ResourceGroupName $ResourceGroup -Name $node

New-AzDataCollectionRuleAssociation `
-TargetResourceId $arcServer.Id `
-AssociationName "assoc-$node" `
-RuleId $dcrResourceId

Write-Host "✅ DCR associated with $node" -ForegroundColor Green
}

Validation

Verify AMA Installation

# Check AMA extension status on all nodes
foreach ($node in $ClusterNodes) {
$extension = Get-AzConnectedMachineExtension `
-ResourceGroupName $ResourceGroup `
-MachineName $node `
-Name "AzureMonitorWindowsAgent"

if ($extension.ProvisioningState -eq "Succeeded") {
Write-Host "✅ $node - AMA installed successfully" -ForegroundColor Green
} else {
Write-Host "❌ $node - AMA status: $($extension.ProvisioningState)" -ForegroundColor Red
}
}

Verify Data Collection

Wait 5-10 minutes after configuration, then verify data is flowing:

// Run in Log Analytics workspace
Heartbeat
| where Computer in ("{{CLUSTER_NODE_01_NAME}}", "{{CLUSTER_NODE_02_NAME}}")
| where TimeGenerated > ago(30m)
| summarize LastHeartbeat = max(TimeGenerated) by Computer
| order by Computer asc

Verify Performance Data

// Check performance counter collection
Perf
| where Computer in ("{{CLUSTER_NODE_01_NAME}}", "{{CLUSTER_NODE_02_NAME}}")
| where TimeGenerated > ago(1h)
| summarize Count = count() by Computer, ObjectName
| order by Computer, ObjectName

Troubleshooting

IssuePossible CauseResolution
AMA installation failsArc agent not healthyRun azcmagent show on node
No data in workspaceDCR not associatedVerify DCR associations
Extension timeoutNetwork connectivityCheck firewall rules for Azure Monitor endpoints
Duplicate dataLegacy agent still runningRemove Log Analytics agent

Required Endpoints

Ensure these endpoints are accessible from cluster nodes:

EndpointPortPurpose
*.ods.opinsights.azure.com443Data ingestion
*.oms.opinsights.azure.com443Agent management
*.monitoring.azure.com443Metrics ingestion
*.handler.control.monitor.azure.com443DCR configuration

Variables Reference

VariableDescriptionExample
{{CLUSTER_NODE_01_NAME}}First cluster node hostnameazl-dal-n01
{{CLUSTER_NODE_02_NAME}}Second cluster node hostnameazl-dal-n02
{{LOG_ANALYTICS_WORKSPACE_NAME}}Workspace namelaw-azl-dal-prod-01
{{SITE_CODE}}Site identifierdal

Next Steps

After configuring Azure Monitor Agent:

  1. ➡️ Task 3: Enable HCI Insights — Enable the Insights workbook
  2. Verify data collection is working before enabling Insights
  3. Create baseline queries for operational monitoring

PreviousUpNext
← Task 01: Log Analytics WorkspacePhase 02: Monitoring & ObservabilityTask 03: HCI Insights →

VersionDateAuthorChanges
1.0.02026-03-24Azure Local Cloudnology TeamInitial release