Skip to main content

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

Values from infrastructure.yml​

The script reads these keys from infrastructure.yml (schema 5). Each key, with its type, default and example, is in the variables reference.

azure.tenant_id, azure.subscription_id, azure.resource_group, cluster.name
operations.monitoring.enabled false means: do nothing

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 Portal → Azure Arc → Servers
  2. Select each cluster node (e.g., {{CLUSTER_NODE_01_NAME}})
  3. Go to Settings → Extensions
  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: Data Collection Rule (created by Insights, Task 03)​

Do not build the data collection rule of Insights by hand. Microsoft Learn (Monitor a single Azure Local system with Insights) strongly recommends against creating your own rule: the rule Insights creates includes a special data stream that Insights needs. Insights creates it (prefix AzureStackHCI-) when you enable Insights in Task 03, and you can edit that rule later to collect more data.

Learn lists what the rule collects; Task 03 checks it, read only, before it associates the rule with the nodes:

DataLearn's list
Performance countersMemory(*)\Available Bytes, Network Interface(*)\Bytes Total/sec, Processor(_Total)\% Processor Time, RDMA Activity(*)\RDMA Inbound Bytes/sec, RDMA Activity(*)\RDMA Outbound Bytes/sec
Windows event log channelsMicrosoft-Windows-Health/Operational, Microsoft-Windows-SDDC-Management/Operational
DestinationThe Log Analytics workspace of Task 01

Associate DCR with Cluster Nodes​

The association of the Insights rule with every node is done by Task 03: Enable-HciInsights.ps1 (or its Azure CLI twin) checks the rule against Learn's list above, then associates it with the Arc machine of each node under the name <machine>-dataCollectionRuleAssociations that the Learn policy uses. This task's script installs the agent only.

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

Toolkit Reference

Scripts for this task are located in the azurelocal-toolkit repository under scripts/deploy/ in the appropriate task folder.


Alternatives​

The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.

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

VersionDateAuthorChanges
1.0.02026-03-24Azure Local CloudInitial release

Version Control​

VersionDateAuthorChanges
1.0.02025-03-25Azure Local CloudInitial release
1.1.02026-11-16Azure Local CloudStep 2.2 follows Learn (Insights creates the rule; Task 03 checks and associates it); script parameters and exit codes