This content was provided as a Professional Contribution through the FinOps Certified Professional program.
Summary: Running multiple monitoring agents—specifically the legacy Microsoft Monitoring Agent (MMA) alongside the newer Azure Monitor Agent (AMA)—leads to duplicated telemetry data and unnecessary cloud costs. Practitioners can use Azure Resource Graph Explorer to quickly query and list all Virtual Machines, identifying which instances have dual agents, a single agent, or no monitoring installed at all. Once identified, FinOps teams should collaborate with engineering to validate agent requirements, utilizing Azure’s removal utilities to strip outdated MMA deployments.
To effectively perform this work, you must have access to Azure subscription(s) which have Virtual Machine(s) running.
In the Azure Portal, go to Azure Resource Graph Explorer and run the following query. This will return a list of all VMs that you have reader access to and the status of monitoring agents on each VM.
Resources | where type == "microsoft.compute/virtualmachines" | extend vmName = name | project vmName, resourceGroup, subscriptionId | join kind=leftouter ( Resources | where type == "microsoft.compute/virtualmachines/extensions" | extend vmName = tostring(split(id, "/")[8]) | extend extType = tostring(properties.type) | summarize agents = make_set(extType) by tostring(vmName), resourceGroup, subscriptionId ) on vmName, resourceGroup, subscriptionId | extend HasAMA = array_index_of(agents, "AzureMonitorWindowsAgent") != -1 or array_index_of(agents, "AzureMonitorLinuxAgent") != -1 | extend HasMMA = array_index_of(agents, "MicrosoftMonitoringAgent") != -1 or array_index_of(agents, "OmsAgentForLinux") != -1 | extend AgentStatus = case( HasAMA and HasMMA, "Both AMA & MMA", HasAMA, "Only AMA", HasMMA, "Only MMA", array_length(agents) == 0, "No Agents", "Other" ) | project vmName, AgentStatus, agents
The output of the query is a table with the following columns, which can be downloaded as a CSV if required for further analysis:
The list of VMs generated in step 1 should be examined by Engineers to determine any action required.
MMA/OMS Discovery and Removal Utility
Migrate to Azure Monitor Agent from Log Analytics Agent
Install and Manage the Azure Monitor Agent