How to remove log analytics agent from azure vm to minimise the duplicate costs incurred by azure monitor agent and log analytics agent

Ishan Saxena 20 Reputation points

As Azure is depreciating log analytics agent, we have configured azure monitor agent as well due to which we got message displaying - The virtual machine is onboarded via Microsoft monitoring agent as well as azure monitoring agent resulting in duplication of data and increases cost.

How can we remove log analytics agent so double costing is not incurred.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,867 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,285 questions
{count} votes

1 answer

Sort by: Most helpful
  1. tbgangav-MSFT 10,391 Reputation points

    Hi @Ishan Saxena ,

    To remove the Log Analytics agent from an Azure VM, you can follow these steps:

    1. Sign in to the Azure portal.
    2. In the Azure portal, select Virtual Machines.
    3. From the list, select the VM that has the Log Analytics agent installed.
    4. On the left, select Extensions. On the Extensions page, select the Log Analytics agent extension.
    5. On the extension properties page, select Uninstall.

    After you have uninstalled the Log Analytics agent, you should verify that no Log Analytics agents are still connected to your Log Analytics workspace. To do this, you can run a log query in Log Analytics. This query will show the last heartbeat for each computer. If a computer has both agents, it will return two records, each with a different category. The Azure Monitor agent will have a category of Azure Monitor Agent. The Log Analytics agent will have a category of Direct Agent. If you find that there are still machines with both agents sending data to your Log Analytics workspace, you should remove the Log Analytics agent from those machines to avoid duplicate data and extra ingestion costs.