Got your attention? Good! Let’s talk about what is going to happen on the 31st of August.
The Log Analytics Agent, or the Microsoft Monitoring Agent (MMA), is being deprecated, so most likely, you will have to take some actions. The Azure Monitor Agent (AMA) is the replacement for the Log Analytics Agent, so you need to migrate. There is a little catch though. It’s not as simple as removing one and installing the other, and that’s because they don’t really work the same. Let’s take a look at how to migrate to the AMA.
Let’s migrate
Microsoft has a Workbook that assists with the migration to the AMA. To access it, go to the Azure portal and navigate to Monitor. In the navigation bar, select Workbooks and click on AMA Migration Helper.
You will see a dashboard with multiple tabs containing details of all of your subscriptions, workspaces and workloads. If you scroll to the migration section at the bottom, you will see a breakdown of the resource types and their current migration status. This will give you an idea of the amount of work that needs to be done.
If you navigate to the Workspaces tab, you will see a list of all the different Log Analytics Agents and VMs that are connected to each workspace.
On the Solutions tab, it also displays the legacy solutions, along with the recommended new solution you need to transition to.
When you click on the Data Collection Rules tab, it displays any Data Collection Rules that are already present.
Depending on your environment, there may be many or few Log Analytics agents. The best advice I can give is to migrate the agents gradually. Start with a test group and migrate it to the Azure Monitor Agent. Maintain the momentum because before you know it, will be August 31st.
If you’ve been using Log Analytics for a while, chances are that you have a lot invested in it, and you are probably worried that it would take ages to transition everything over. Fortunateley, Microsoft came up with a script to assist you. Visit https://learn.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-migration-tools#installing-and-using-dcr-config-generator for the script and instructions.
- Download the script and save it.
- Open Powershell and run the script with the provided parameters from the Microsoft website.
.\WorkspaceConfigToDCRMigrationTool.ps1 -SubscriptionId $subId -ResourceGroupName $rgName -WorkspaceName $workspaceName -DCRName $dcrName -OutputFolder $outputFolderPath.
Now, you will have the JSON files that will handle everything. Open one of the JSON files and copy all of its content. Then, in the Azure portal, search for Deploy a custom template. Click on Build your own template in the editor, paste everything in, and click Save. Fill in all the details of the deployment and proceed with creating the deployment.
You will need to repeat these steps for all of your JSON files and for each workspace you have.
Out with the old, in with the new
Alright, we’re almost there! All that’s left is to remove the old Log Analytics Agent and install the new Azure Monitor Agent.
To remove the Log Analytics Agent, simply go to the machine and remove the Microsoft Monitoring Agent. If you only have a few machines, this method will work for you. But what if you have a ton of machines?
For removing the agent at scale, download the MMA Discovery and Removal Utility from Microsoft. Follow the instructions that suit your environment.
Now it’s time for the Azure Monitor Agent. Again, there are two ways. A manual way and the automated way.
For the manual way, navigate to Monitor in the Azure portal. Then select Data Collection Rules. From the Data Collection Rules screen, select the desired data collection rule. Select View resources and click Add.
For deployment at scale, Azure Policy has you covered. In the Azure portal, search for Policy. go to Definitions and search for Enable Azure Monitor for VMs with Azure Monitoring Agent(AMA). Assign the initiative to the desired scope.
I am not covering all the steps to assign the initiative. If you need guidance on how to assign an initiative, you can visit this Microsoft page.
There is one aspect that can be a bit tricky. When assigning the initiative, it will ask you for the VMI Data Collection Rule Resource Id. This can be found on the Overview page of your Data Collection Rule. On the right, click on JSON view and copy the content of the ImmutableId property.
The initiative is only applied to new machines. To include existing machines in the scope, you will need to configure a remediation task. This task will apply the initiative to the existing machines.
And there you have it! While the migration to the Azure Monitor Agent may initially seem challenging, I hope this post has demonstrated that it’s a manageable process with the right tools and planning. Remember, the key to a successful migration is preparation and testing. Take the time to understand your environment and devise a migration plan that suits your specific needs.
It’s important to remember that while the Log Analytics Agent is being deprecated, the powerful monitoring and analytics it enabled are still available in the Azure Monitor Agent. By migrating now, you ensure your systems continue to benefit from the best monitoring tools Microsoft has to offer.
Thank you for reading and best of luck with your migration!