Migrate to Azure Monitor Agent from Log Analytics agent in VM Insights
Log Analytics agent for Azure Monitor was retired on August 31, 2024 and replaced with Azure Monitor agent. This article describes how to migrate to Azure Monitor agent for machines that you previously onboarded to VM insights using Log Analytics agent.
- Get full details about the Azure Monitor agent from Azure Monitor Agent overview.
- Get additional migration details including the advantages of the new agent at Migrate to Azure Monitor Agent from Log Analytics agent.
Prerequisites
- See Azure Monitor agent supported operating systems and environments to verify that your operating system is supported by Azure Monitor agent.
- See Dependency Agent requirements to verify that your operating system is supported by Dependency agent.
- Dependency agent is no longer a requirement for VM insights. It's only required if you choose the option to collect processes and dependencies using the VM insights Map feature. If you don't choose this option then Dependency agent isn't installed.
Data collection rules
Azure Monitor agent requires Data Collection Rules (DCRs) to specify which data to collect and how it should be processed. If you use the Azure portal to migrate VM insights, a DCR will be created for you. If you use other methods to enable VM insights, then you first need to create a DCR either by enabling a machine with the Azure portal or by downloading and installing the VM insights DCR templates.
Enable Azure Monitor agent
Enable the Azure Monitor agent using any of the available methods while the Log Analytics agent is still installed. The two agents can coexist on the same machine. Ensure that the Azure Monitor agent is configured properly and is collecting data before removing the Log Analytics agent.
Remove Log Analytics agent
Warning
Collecting duplicate data from a single machine with both the Azure Monitor agent and Log Analytics agent can result in:
- Additional cost of ingestion duplicate data to the Log Analytics workspace.
- The map feature of VM insights may be inaccurate since it does not check for duplicate data. For more information about
Once you've verified that the Azure Monitor agent has been enabled, remove the Log Analytics agent from the machine to prevent duplicate data collection. See Uninstall agent for details on removing a single agent or MMA/OMS Discovery and Removal Utility for details on the tool for removing multiple agents.
Migrate with Azure portal
Use the following procedure to enable VM insights using the Azure Monitor agent on a machine that was previously enabled using Log Analytics agent. This method creates the required DCR or lets you select an existing one. It doesn't remove the Log Analytics agent from the machine though, so you still must perform this task after enabling the machine.
From the Monitor menu in the Azure portal, select Virtual Machines > Overview > Monitored.
Select Configure using Azure Monitor agent next to any machine that you want to enable. If a machine is currently running, you must start it to enable it.
On the Monitoring configuration page, select Azure Monitor agent and select a rule from the Data collection rule dropdown.
The Data collection rule dropdown lists only rules configured for VM insights. If a data collection rule hasn't already been created for VM insights, Azure Monitor creates a rule with:
- Guest performance enabled.
- Processes and dependencies enabled for backward compatibility with the Log Analytics agent.
Select Create new to create a new data collection rule. This lets you select a workspace and specify whether to collect processes and dependencies using the VM insights Map feature.
Note
Selecting a data collection rule that does not use the Map feature does not uninstall Dependency Agent from the machine. If you do not need the Map feature, uninstall Dependency Agent manually.
With both agents installed, Azure Monitor displays a warning that you may be collecting duplicate data.