Azure Monitor Agent not sending data
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Day-to-day operations
-
Phase 3: Enterprise architecture
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
“Azure Monitor Agent not reporting” is a quiet kind of failure. No error pops up, the dashboards go flat and alerts stop firing, and most of the time you only find out when someone asks why there were no alerts during an outage.
Azure Monitor Agent (AMA) needs five things before it can send data: a running VM, the AMA extension, a managed identity to authenticate with, a data collection rule (DCR) associated with the VM, and an outbound network path to Azure Monitor. Even when all five are in place, a DCR that collects the wrong things looks the same as an agent that sends nothing.
In the lab you’ll go back to web01 and the DCR you built in Lesson 32 and work out why it has stopped reporting. After that you’ll break the DCR’s scope and the identity and fix each one in turn.
| Time | You need | Cost | By the end you can |
|---|---|---|---|
| About 60 minutes | web01 in rg-saat-vms with AMA, dcr-saat-basic and law-saat from Lesson 32, the CLI | About 10 US cents: web01 running for an hour and a temporary NAT gateway for its outbound access | Check every link AMA depends on, find missing data in the DCR, and fix identity and network problems |
What it is, in one line
Azure Monitor Agent only sends data when the VM, the extension, the identity, the DCR association and the network path are all in place.
In Simple Words
The newspaper delivery boy
Think of the boy who delivers your newspaper every morning. For the paper to reach you, he has to be working that day (VM running), have his bicycle (the agent), carry the ID card that gets him into the printing press (managed identity), have your address on his list (DCR association), and find the road open (network). If any one of those is missing, there’s no paper. There’s also a sneakier problem, where he turns up every day with the paper but your order says “sports page only”, so you never see the business news you wanted. That’s a DCR collecting the wrong log levels: the agent is fine, but the data you want was never ordered.
Engineer's View
What AMA depends on
- Extension: AzureMonitorLinuxAgent or AzureMonitorWindowsAgent, installed through the VM agent and showing provisioned Succeeded.
- Identity: AMA authenticates using the VM’s system-assigned managed identity (or a user-assigned one). Sending data doesn’t need any role, but the identity has to exist.
- DCR association: if there isn’t at least one association, AMA has nothing to collect and nowhere to send it, so you won’t even get a heartbeat.
- DCR content: the data sources (performance counters, syslog facilities and levels, Windows event XPath), the destinations (workspaces) and the data flows. Anything that isn’t listed is never collected.
- Network: HTTPS to the Azure Monitor control and ingestion endpoints (global.handler.control.monitor.azure.com, the region’s handler, and the workspace’s ods.opinsights.azure.com), or private link through an Azure Monitor Private Link Scope.
- Workspace: once a daily cap is reached, ingestion stops for the rest of the day, and law-saat has a 0.1 GB cap.
- Logs on the VM: /var/opt/microsoft/azuremonitoragent/log/ on Linux (mdsd.err, mdsd.warn), C:\WindowsAzure\Resources\AMADataStore.* on Windows.
How it works, step by step
When a machine stops reporting, check things in this order:
- Heartbeat: query the workspace first. If there’s no heartbeat, the agent isn’t sending anything at all, and if there’s a heartbeat but data is missing, look at the DCR.
- VM and extension: the VM is running, the VM agent is Ready and the AMA extension shows Succeeded.
- Identity and association: the VM has a managed identity and at least one DCR associated with it.
- Network: the VM can reach the Azure Monitor endpoints, and mdsd.err shows no connection errors.
- DCR content: the data you’re expecting is in a data source and flows to the workspace you’re querying.
The heartbeat query splits the problem in two, telling you whether to look at the agent’s plumbing (steps 2 to 4) or at what it was told to collect (step 5).
Check the obvious thing too: are you querying the same workspace the DCR sends to? Teams with several workspaces lose hours to this one.
Find out why web01 stopped reporting
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
1Is web01 reporting?
Start web01 and look up its last heartbeat in law-saat:
az vm start --resource-group rg-saat-vms --name web01
$ws = az monitor log-analytics workspace show --resource-group rg-saat-core --workspace-name law-saat --query customerId -o tsv
az monitor log-analytics query --workspace $ws --analytics-query "Heartbeat | where Computer == 'web01' | summarize last_heartbeat = max(TimeGenerated)" -o tableYou’ll see either a last heartbeat from Lesson 32, days ago, or nothing at all, which means web01 isn’t reporting.
2Walk the checklist
Now check the VM agent, the AMA extension, the identity and the DCR associations:
az vm get-instance-view --resource-group rg-saat-vms --name web01 --query "instanceView.vmAgent.statuses[0].displayStatus" -o tsv
az vm extension show --resource-group rg-saat-vms --vm-name web01 --name AzureMonitorLinuxAgent --query provisioningState -o tsv
az vm show --resource-group rg-saat-vms --name web01 --query identity.type -o tsv
$vmId = az vm show --resource-group rg-saat-vms --name web01 --query id -o tsv
az rest --method get --url "https://management.azure.com${vmId}/providers/Microsoft.Insights/dataCollectionRuleAssociations?api-version=2022-06-01" --query "value[].name" -o tsvYou should see something like this:
Ready
Succeeded
SystemAssigned
dcra-saat-basicThe agent, extension, identity and association all look fine, which leaves the network. web01 sits in a private subnet and you removed the temporary NAT gateway in Lesson 32, so the agent has no way to reach Azure Monitor. You can confirm it in the agent’s own log:
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts 'tail -n 3 /var/opt/microsoft/azuremonitoragent/log/mdsd.err' --query "value[0].message" -o tsvYou should see recent lines about failed connections or timeouts to the Azure Monitor endpoints.
3Give web01 an outbound path
Add a temporary NAT gateway to snet-web, wait about 5 minutes and check the heartbeat again:
az network public-ip create --resource-group rg-saat-core --name pip-nat-l70 --sku Standard -o none
az network nat gateway create --resource-group rg-saat-core --name nat-l70 --public-ip-addresses pip-nat-l70 -o none
az network vnet subnet update --resource-group rg-saat-core --vnet-name vnet-saat --name snet-web --nat-gateway nat-l70 -o none
az monitor log-analytics query --workspace $ws --analytics-query "Heartbeat | where Computer == 'web01' | summarize last_heartbeat = max(TimeGenerated)" -o tableThis time there should be a heartbeat from the last few minutes, for example:
Last_heartbeat
----------------------------
2026-10-21T09:41:03.0000000Z

✅ Checkpoint: You walked the AMA checklist, found the network gap from the agent’s log, and web01 is reporting again.
Break It, Then Fix It
Leave web01 running and the NAT gateway in place, because you need both for the breaks.
1Break it: heartbeat is fine, but the app’s logs are missing
The app on web01 writes an informational message to syslog, and the app team says it never shows up:
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts 'logger -p user.info saatvedha app started; logger -p user.warning saatvedha disk almost full; echo sent' --query "value[0].message" -o tsv
Start-Sleep -Seconds 300
az monitor log-analytics query --workspace $ws --analytics-query "Syslog | where TimeGenerated > ago(30m) and SyslogMessage has 'saatvedha' | project TimeGenerated, SeverityLevel, SyslogMessage" -o tableYou’ll see only the warning:
TimeGenerated SeverityLevel SyslogMessage
---------------------------- --------------- ---------------------------
2026-10-21T09:47:12.0000000Z warning saatvedha disk almost fullSo the agent is working, because the warning arrived, but the info message was never collected. Look at what the DCR asks for:
$sub = az account show --query id -o tsv
$dcrId = "/subscriptions/$sub/resourceGroups/rg-saat-core/providers/Microsoft.Insights/dataCollectionRules/dcr-saat-basic"
az rest --method get --url "https://management.azure.com${dcrId}?api-version=2022-06-01" --query "properties.dataSources.syslog[].{name:name, facilities:join(',', facilityNames), levels:join(',', logLevels)}" -o tableYou should see something like this:
Name Facilities Levels
----------- ------------------------ ---------------------------------------
syslog-base auth,daemon,syslog,user Warning,Error,Critical,Alert,EmergencyThe DCR from Lesson 32 collects Warning and above. That was a sensible choice for cost, and it’s the reason the info message never left the VM.
Fix it carefully with a read-modify-write: save the current DCR, add a source for user Info and Notice only, and put it back:
New-Item -ItemType Directory -Force C:\azure-lab\l70 | Out-Null
az rest --method get --url "https://management.azure.com${dcrId}?api-version=2022-06-01" -o json | Set-Content C:\azure-lab\l70\dcr-original.json
$dcr = Get-Content C:\azure-lab\l70\dcr-original.json -Raw | ConvertFrom-Json
$src = [pscustomobject]@{ name = 'syslog-user-info'; streams = @('Microsoft-Syslog'); facilityNames = @('user'); logLevels = @('Info', 'Notice') }
$dcr.properties.dataSources.syslog += $src
$body = @{ location = $dcr.location; properties = @{ dataSources = $dcr.properties.dataSources; destinations = $dcr.properties.destinations; dataFlows = $dcr.properties.dataFlows } }
$body | ConvertTo-Json -Depth 20 | Set-Content C:\azure-lab\l70\dcr-new.json
az rest --method put --url "https://management.azure.com${dcrId}?api-version=2022-06-01" --body '@C:\azure-lab\l70\dcr-new.json' --query "properties.provisioningState" -o tsvYou should see Succeeded, and the agent picks up the change within a few minutes. Send another info message and query again:
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts 'logger -p user.info saatvedha app restarted; echo sent' --query "value[0].message" -o tsv
Start-Sleep -Seconds 300
az monitor log-analytics query --workspace $ws --analytics-query "Syslog | where TimeGenerated > ago(10m) and SyslogMessage has 'saatvedha app' | project TimeGenerated, SeverityLevel, SyslogMessage" -o tableThe info message now appears.
2Break it: the identity is removed
Now someone tidies up “unused” managed identities and removes web01’s along with the rest:
az vm identity remove --resource-group rg-saat-vms --name web01 -o none
Start-Sleep -Seconds 900
az monitor log-analytics query --workspace $ws --analytics-query "Heartbeat | where Computer == 'web01' | summarize last_heartbeat = max(TimeGenerated)" -o table
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts 'tail -n 3 /var/opt/microsoft/azuremonitoragent/log/mdsd.err' --query "value[0].message" -o tsvThe last heartbeat stops moving forward, and the agent log shows errors about getting a token or authenticating, something like this:
Last_heartbeat
----------------------------
2026-10-21T09:53:40.0000000Z
[stdout]
... Failed to get access token from IMDS ... identity not found ...Without an identity, AMA can’t prove which VM it is, so Azure Monitor refuses its data even though nothing changed in the DCR or the network. An identity can look “unused” because no role assignment refers to it, and that’s precisely the situation with AMA.
To fix it, give web01 a system-assigned identity again and wait for the heartbeat:
az vm identity assign --resource-group rg-saat-vms --name web01 -o none
Start-Sleep -Seconds 600
az monitor log-analytics query --workspace $ws --analytics-query "Heartbeat | where Computer == 'web01' | summarize last_heartbeat = max(TimeGenerated)" -o tableThe heartbeat is current again.

3Clean up
Put the DCR back the way it was, then remove the NAT gateway and deallocate web01:
$orig = Get-Content C:\azure-lab\l70\dcr-original.json -Raw | ConvertFrom-Json
@{ location = $orig.location; properties = @{ dataSources = $orig.properties.dataSources; destinations = $orig.properties.destinations; dataFlows = $orig.properties.dataFlows } } | ConvertTo-Json -Depth 20 | Set-Content C:\azure-lab\l70\dcr-restore.json
az rest --method put --url "https://management.azure.com${dcrId}?api-version=2022-06-01" --body '@C:\azure-lab\l70\dcr-restore.json' -o none
az network vnet subnet update --resource-group rg-saat-core --vnet-name vnet-saat --name snet-web --remove natGateway -o none
az network nat gateway delete --resource-group rg-saat-core --name nat-l70
az network public-ip delete --resource-group rg-saat-core --name pip-nat-l70
az vm deallocate --resource-group rg-saat-vms --name web01✅ Checkpoint: You found three different reasons for “no data”: network, DCR content and identity, and you put everything back as it was.
This happened at work
The alert that never fired
An online retailer had a log search alert for “out of memory” messages from its Java services. During a sale, three servers ran out of memory and kept restarting for 40 minutes, and the alert never fired. In the incident review, everyone assumed Azure Monitor itself was broken.
When someone finally checked, heartbeats were fine on every server. The Java services logged their memory errors to syslog facility local0, but the DCR only collected auth, daemon, syslog and user, so the query was right and the data had never been collected in the first place.
It turned out a platform team had applied a new DCR months earlier, and it had quietly replaced an older one that included local0.
What they changed: every alert rule now has a “canary” test that writes a matching message once a day and checks that it arrives. DCR changes go through review along with a list of the alerts that depend on them, and a workbook compares the heartbeat count against the servers they expect, so silent agents stand out.
Common mistakes and troubleshooting
| Mistake | What you see | What to do |
|---|---|---|
| No DCR association | No heartbeat at all | Associate at least one DCR with the VM. |
| No outbound path or private link | Heartbeat stops; network errors in mdsd.err | NAT, proxy, or Azure Monitor Private Link Scope. |
| Identity removed | Heartbeat stops; token errors | Restore the managed identity. |
| DCR collects the wrong levels or facilities | Heartbeat fine, data missing | Add the facility and level to the DCR. |
| Querying a different workspace | “No data” in the wrong place | Check the DCR destination workspace. |
| Daily cap reached | Data stops mid-day | Review the cap and ingestion volume. |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and under it you’ll find why they ask and one way you could answer in your own words.
Fresher level
1. What does Azure Monitor Agent need to send data?
Why they ask this: The basic concept.
How you might answer: It needs the extension, a managed identity, an associated data collection rule and network access to the Azure Monitor endpoints.
2. What is a data collection rule?
Why they ask this: Basic vocabulary.
How you might answer: It’s a resource that defines what to collect (counters, logs, events), how to transform it and where to send it, and you associate it with machines.
3. How do you check whether an agent is alive?
Why they ask this: A daily check.
How you might answer: I’d query the Heartbeat table for that computer and look at the latest time.
2–5 years experience
4. Heartbeat works but syslog data is missing. Why?
Why they ask this: A real troubleshooting path.
How you might answer: Usually the DCR doesn’t include that facility or level. It could also be going to another workspace, a transformation could be dropping it, or the app writes somewhere else. I’d check the DCR content first.
5. No heartbeat from a VM. What do you check?
Why they ask this: Systematic method.
How you might answer: I’d check that the VM is running and the VM agent is Ready, then the AMA extension state, the managed identity, the DCR association, outbound access or private link, and finally the agent logs on the VM.
6. How do you change a DCR safely?
Why they ask this: Change practice.
How you might answer: Export the current definition, change a copy, PUT it back and keep the original so you can roll back. Better still, manage DCRs as code with reviews.
Senior level
7. How do you make sure monitoring itself is monitored?
Why they ask this: Senior thinking.
How you might answer: Alerts on missing heartbeats for each server group, canary messages for the critical alert rules, dashboards that compare expected machines with reporting ones, and alerts on ingestion caps.
8. How would you design DCRs for 1,000 servers?
Why they ask this: Architecture.
How you might answer: I’d keep a small set of layered DCRs by role (base, web, database), associate them through Azure Policy and store them as code, with transformations to cut noise and cost.
9. When do you need Azure Monitor Private Link Scope?
Why they ask this: Network design.
How you might answer: When agents have no internet path, or policy doesn’t allow one. AMPLS gives you private endpoints for ingestion and control, and you set up DNS for it the same way as for other private endpoints.
Quick quiz
Q1. No heartbeat and no DCR association. Result?
- Data flows anyway
- Nothing is collected or sent
- Only performance data
- Only heartbeat
Show answer
B — AMA needs an association.
Q2. Heartbeat fine, info messages missing. Most likely?
- Network down
- DCR collects only Warning and above
- Identity removed
- Workspace deleted
Show answer
B — The DCR decides what is collected.
Q3. Where are AMA logs on Linux?
- /var/log/azure
- /var/opt/microsoft/azuremonitoragent/log
- /etc/ama
- /tmp
Show answer
B — mdsd.err and mdsd.warn live there.
Q4. Identity removed from the VM. Effect?
- None
- AMA can’t authenticate; data stops
- Only alerts stop
- The VM stops
Show answer
B — AMA uses the managed identity.
Q5. Safest way to change a DCR by hand?
- Delete and recreate
- Save, modify a copy, PUT back
- Edit on the VM
- Restart the agent
Show answer
B — Keep the original to roll back.
Quick recap
By now you can work out why a machine has gone quiet, and tell an agent problem from a collection problem with one query.
- Heartbeat splits the problem: plumbing or collection.
- AMA needs extension, identity, association and network.
- A DCR only collects what it lists.
- Removing a managed identity silently stops AMA.
- Monitor the monitoring: heartbeat gaps and canary messages.
Next lesson
Lesson 71: Load Balancer and Application Gateway 502 errors → Next you’ll fix 502 errors and unhealthy backends on Load Balancer and Application Gateway, from probes through to certificates.
Further reading: Azure Monitor Agent not reporting
Want to go deeper into Azure Monitor Agent not reporting? See Microsoft’s Troubleshoot Azure Monitor Agent on Linux and Data collection rules in Azure Monitor. You can also see the full plan for this course on the Azure Cloud Administration course page.
