This article’s objective is to share a feedback andadditional tipsconcerning this migration.
In addition to consolidating and improving on the legacy Log Analytics agents, Azure Monitor Agent providesa variety of immediate benefits, including cost savings, a simplified management experience, and enhanced security and performance.
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.
Beforeassigning 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 throughaz clifor 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--usernamefor 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 tableInsightsMetricsto thePerftable.
| 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 →
| where CounterName == "% Free Space"
| where InstanceName == "/" //Filter on the Operating system disk
| summarize ["% Free Space"]=avg(CounterValue) by Computer, bin(TimeGenerated, 10m)
| render timechart
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.
| where type == "microsoft.compute/virtualmachines" or type == "microsoft.compute/virtualmachinescalesets"
| extend instanceCount = iif(type == "microsoft.compute/virtualmachines", 1 , toint(sku.capacity))
| summarize ["Existing VM or VMSS"]=sum(instanceCount)
The following query can be executed from theLogspanel of the Log Analytics Workspace connected to yourData collection rules (DCR), it will display the number of VM and VMSS that have sent heartbeats.
| where Category == "Azure Monitor Agent"
| summarize ["VM or VMSS enrolled"]=count()
This migration iswell documentedby Microsoft but it should be followed carefully especially in complex environments, it is not what we can call a “simple and transparent” migration.