Open In App

How to Find AMA Agent Installed on Azure Virtual Machines using KQL Query?

Azure Monitor Agent simply known as AMA. It is a software agent that collects monitoring data from Windows and Linux machines, in Azure and non-Azure environments, including on-premises and third-party clouds. Basically, there are two types of AMA agents:

Checking whether the Azure Monitor Agent (AMA) is installed or not is a difficult task when you have a lot many Azure virtual machines (VMs). To simplify the process, here in this article, we will use the Azure Kusto Query Language (KQL) resource graph query to quickly check which Azure VMs installed with the Azure Monitor Agent for Windows and the Azure Monitor Agent for Linux. Azure Portal Access and RBAC policy read access to play a major role in knowing more about RBAC policy read access to play a major role.



Steps to Find the AMA Agent Installed Azure Virtual Machines

Step 1: Login to Azure Portal

Step 2: Access the Access Azure Resource Graph Explorer from global search



Step 3: Select the target scope either subscription or management group

Step 4: Run the Query in Azure Resource Graph Explorer

For Windows Azure Virtual Machines: Copy paste the below KQL Azure Resource Graph in Resource Graph Explorer to fetch the details of Azure Virtual machines installed with Azure Monitoring Windows Agent.

resources
| where type == "microsoft.compute/virtualmachines/extensions"
| extend VMName = split(id, "/")
| where name has "AzureMonitorWindowsAgent"
| extend SubscriptionName=case(
subscriptionId =~ 'add subscription id', 'add subscription name',
subscriptionId)
| project VMName=VMName[-3], AgentName=name, SubscriptionName

For Linux Azure Virtual Machines: Copy paste the below KQL Azure Resource Graph in Resource Graph Explorer to fetch the details of Azure Virtual machines installed with Azure Monitoring Linux Agent.

resources
| where type == "microsoft.compute/virtualmachines/extensions"
| extend VMName = split(id, "/")
| where name has "AzureMonitorLinuxAgent"
| extend SubscriptionName=case(
subscriptionId =~ 'add subscription id', 'add subscription name',
subscriptionId)
| project VMName=VMName[-3], AgentName=name, SubscriptionName

Both Windows and Linux Azure Virtual Machines: Use this KQL query to fetch the details of both Azure Monitoring Windows Agent and Linux Agent.

resources
| where type == "microsoft.compute/virtualmachines/extensions"
| extend VMName = split(id, "/")
| where name has "AzureMonitorWindowsAgent" or name has "AzureMonitorLinuxAgent"
| extend SubscriptionName=case(
subscriptionId =~ 'add subscription id', 'add subscription name',
subscriptionId)
| project VMName=VMName[-3], AgentName=name, SubscriptionName

That it! I hope these Azure Kusto Query Language (KQL) resource graph query will helps you to quickly check the Azure VMs installed with the Azure Monitor Agent (AMA).

Benefits of Using the Azure Monitor Agent

FAQs On Azure Virtual Machines Using KQL Query

1. How many Platform supports Azure Monitor Agent?

Azure Monitor Agent can be installed on a variety of platforms, including: Azure virtual machines, On-premises servers and Azure Cloud-based applications.

2. Which Is The Easiest Method To Export AMA Servers List?

Azure KQL Resource Graph query is the simplest and easiest method where you can export the AMA installed servers list in less than a minute.

Article Tags :