Loading...

Tips when migrating to Azure Monitor Agent from Log Analytics agent

Tips when migrating to Azure Monitor Agent from Log Analytics agent

Introduction

The Log Analytics agent will be retired on August 31, 2024, it is recommended to start planning your migration to Azure Monitor Agent by using the information in the following article: Migrate to Azure Monitor Agent from Log Analytics agent.

 

This article’s objective is to share a feedback and additional tips concerning this migration.

 

Benefits

In addition to consolidating and improving on the legacy Log Analytics agents, Azure Monitor Agent provides a variety of immediate benefits, including cost savings, a simplified management experience, and enhanced security and performance.

 

Jamesdld23_5-1688585246615.png

 

 

 

Target sample design

The following points illustrate a sample design that have been implemented to support, maintain and make sure that the Azure Monitor Agent is deployed.

 

  • Core components

Deploying the Data Collection Rules (DCR), Data Collection Endpoint (DCE) and Managed Identities through Terraform. It has the following benefits:

  1. Perform compliance scan through ‘terraform plan’ to guarantee that those resources are properly set with no configuration drift.
  2. Create our resources the same way across different Azure subscription environments.

 

 

  • Agent enrollment

Use built-in policies to deploy the Azure Monitor Agent, the DCR associations at scale and the managed identities associations with our VMs and VMSSs. It has the following benefits:

  1. Auto-enrollment, indeed Microsoft provides Azure policies that are set to remediate non compliant resources. For more information you can consult the following article: An Azure Policy journey.
  2. The Azure policy compliance panel gives us an overview of the health status of our Azure Monitor Agent deployment.

 

The following diagram illustrates the mentioned design:

 
Jamesdld23_4-1688585162408.png

 

 

Caution points

In this chapter we will share caution points you should be aware when migrating Azure Monitor Agent from Log Analytics agent.

 

  • Managed Identity

It is recommended to use a User-assigned managed identity for large-scale deployments, you can create a user-assigned managed identity once and share it across multiple Virtual Machines (VM) or Virtual Machines Scale Sets (VMSS).

 

Before assigning this User-assigned managed identity across multiple VMs or VMSSs make sure to understand how your developers use Azure Managed Identities, if they do.

 

When authenticating through az cli for exemple you must consider the following caution point ->

If the resource has multiple user assigned managed identities and no system assigned identity, you must specify the client id or object id or resource id of the user assigned managed identity with --username for login. If you don’t, your script might switch to the wrong managed identity, the one needed by the Azure Monitor Agent.

 

  • Azure Monitor Dashboard and Workbook

Validate that Azure Monitor Agent is collecting data as expected and all downstream dependencies.

For exemple we were using the following Kusto query to graph and alert us when disk consumption where high, in our case this information moved from the Log Analytics table InsightsMetrics to the Perf table.

 

Before →

InsightsMetrics | where Name == "FreeSpacePercentage" | extend mountId = tostring(parse_json(Tags).["vm.azm.ms/mountId"]) | where mountId == "/" //Filter on the Operating system disk | summarize ["% Free Space"]=avg(Val) by Computer, bin(TimeGenerated, 10m) | render timechart

 

Now with the Azure Monitor Agent →

Perf | where CounterName == "% Free Space" | where InstanceName == "/" //Filter on the Operating system disk | summarize ["% Free Space"]=avg(CounterValue) by Computer, bin(TimeGenerated, 10m) | render timechart

 

Jamesdld23_3-1688585089773.png

 

 

 

  • Deployment follow up

Make sure your number of Virtual Machines (VM) and Virtual Machines Scale Sets (VMSS) is equals to the number of resources that send heartbeats through the Azure Monitor Agents.

 

The following query can be executed from the Azure Resource Graph Explorer, it will display the existing number of VM and VMSS.

Resources | where type == "microsoft.compute/virtualmachines" or type == "microsoft.compute/virtualmachinescalesets" | distinct(name) | summarize ["Existing VM or VMSS"]=count()

 

 

The following query can be executed from the Logs panel of the Log Analytics Workspace connected to your Data collection rules (DCR), it will display the number of VM and VMSS that have sent heartbeats.

Heartbeat | where Category == "Azure Monitor Agent" | distinct(Computer) | summarize ["VM or VMSS enrolled"]=count()

 

 

 

Conclusion

This migration is well documented by Microsoft but it should be followed carefully especially in complex environments, it is not what we can call a “simple and transparent” migration.

Azure Monitor Agent benefits are definitively great so I would recommend anyone to start this migration as soon as possible.

 

 

See you in the Cloud

Jamesdld

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

Azure Developer CLI: Azure Container Apps Dev-to-Prod Deployment with Layered Infrastructure

This post walks through how to implement “build once, deploy everywhere” patterns using Azure Container Apps with the new azd publ...

13 hours ago

Accelerate Your Growth: Azure Cosmos DB Partner Acceleration Program

Accelerate Your Growth: Azure Cosmos DB Partner Acceleration Program Unlock 360° Success with the Cosmos DB Engineering Team Are you ready to ...

2 days ago

Transforming Field Operations with AI, Azure Maps & Dynamics 365

Efficient field operations are the backbone of successful, data-driven organizations. Yet, many businesses continue to struggle with scattered...

4 days ago

Failures Happen in Cloud, but how Azure Cosmos DB keeps your Applications Online

The only thing that’s constant in distributed systems is failures. No cloud platform is immune to failures — from regional outages and transie...

5 days ago

The `azd` extension to configure GitHub Copilot coding agent integration with Azure

This post shares how to set up the GitHub Copilot coding agent integration with Azure resources and services by using the Azure Developer CLI ...

5 days ago

Announcing Azure MCP Server 1.0.0 Stable Release – A New Era for Agentic Workflows

Today marks a major milestone for agentic development on Azure: the stable release of the Azure MCP Server 1.0! The post Announcing Azure MCP ...

7 days ago

From Backup to Discovery: Veeam’s Search Engine Powered by Azure Cosmos DB

This article was co-authored by Zack Rossman, Staff Software Engineer, Veeam; Ashlie Martinez, Staff Software Engineer, Veeam; and James Nguye...

7 days ago

Azure SDK Release (October 2025)

Azure SDK releases every month. In this post, you'll find this month's highlights and release notes. The post Azure SDK Release (October 2025)...

8 days ago

Microsoft Copilot (Microsoft 365): [Copilot Extensibility] No-Code Publishing for Azure AI Foundry Agents to Microsoft 365 Copilot Agent Store

Developers can now publish Azure AI Foundry Agents directly to the Microsoft 365 Copilot Agent Store with a simplified, no-code experience. Pr...

9 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy