Open In App

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

Last Updated : 20 Sep, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

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:

  • Azure Monitor Agent for Windows installed for Azure Windows Servers. This collects data from Windows machines, such as event logs, performance counters, and system metrics.
  • Azure Monitor Agent for Linux installed for Azure Linux Servers. This Linux agent collects data from Linux machines, such as sys logs and performance counters.

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

KQL Azure

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

Fetching Azure Virtual machine

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

fetching  Azure details Monitoring Windows Agent

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

  • Single Agent for All Data Collection Needs: With Azure Monitor Agent you can collect data from any sources such as Azure virtual machines, on-premises servers, and cloud-based applications.
  • Reduce Cost: Azure Monitor Agent uses data collection rules which enables targeted and granular data collection, which will help to reduce monitoring cost.
  • Security and Performance: Azure Monitor Agent is designed to be secure and efficient. With log data you can monitor and secure your applications or improve performance.
  • Simplified management: Azure Monitor Agent can be managed using Azure Policy, which makes it easy for you to enforce consistent configurations across your machines.

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.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads