Azure – Get ready for depreciation of the legacy Log Analytics agent (preview)

If you work with Azure – either in a full cloud environment or in hybrid configuration – you probable already know the Log Analytics agent used to send to an Azure Log Analytics workspace telemetry about your virtual machines.

The Log Analytics agent is being replaced by Azure Monitor agent which provide more insights about your virtual machines.

As the Log Analytic agent is being deprecated, you need to migrate to the new Azure Monitor agent before August 2021.

So what can you do?

First you may need to discover which resources – either in Azure or on-premises – still use the Log Analytics agent.

Then migrate the Log Analytics agent to Azure Monitor agent.

Do not remove the Log Analytics agent as it may be used by other Azure solutions such as Sentinel, Defender for Cloud or VM Insights. At this stage t

To help you prepare for the migration Microsoft has provided a migration helper which is an Azure workbook to discover which resources are still using the legacy agent and a DCR generator to convert the legacy agent configuration to the new Data Collection rule used by Azure Monitor agent.

Installing the migration helper

The migration helper is an Azure workbook to identify which resources still use the Log Analytics agent and detect dependencies with other solutions.

To install the migration helper, connect to your Azure portal ( and search for Workbooks to create a new workbook

image  image  image

Then access the advanced editor to paste the JSON code available from Services/Azure Monitor/Agents/Migration Tools/Migration Helper Workbook/AMA Migration Helper.workbook

image  image

After applying the change the workbook is loading, you can click on Done editing and save the workbook


The workbook will then identify which resources are still using the Log Analytics agent and their migration status

image  image

Now you know the resources which will need to be migrated to Azure Monitor agent.

Installing the DCR Config Generator

The DCR Config Generator is a PowerShell script which will convert the Log Analytics configuration to corresponding data collection rules.

You need to have Azure PowerShell installed (Install-Module -Name Az) and use PowerShell 5.1 or later.

Download the DCR Config Generator script here Services/Azure Monitor/Agents/Migration Tools/DCR Config Generator/WorkspaceConfigToDCRMigrationTool.ps1

When running the script you will have to provide:

  • SubscriptionId: ID of the subscription that contains the target workspace
  • ResourceGroupName: Resource group that contains the target workspace
  • WorkspaceName: Name of the target workspace
  • DCRName: Name of the new DCR
  • Location: Region location for the new DCR
  • FolderPath (optional): Path in which to save the new data collection rules (ARM templates based on the OS running on the VM – Windows or Linux). By default, Azure Monitor uses the current directory


After reviewing the rule, you can associated the new Data Collection Rule to the virtual machines by following the steps detailed here Monitor data from virtual machines with Azure Monitor agent – Azure Monitor | Microsoft Docs

Leave a Comment

Your email address will not be published. Required fields are marked *