Azure VM Diagnostics Extension. All right,
I have to give you a preliminary warning that Azure VM
monitoring has been undergoing, well,
gradual revision over the last few years, and the story isn't exactly cohesive.
So I'm going to do my best to make it really easy to understand.
The entry level way to monitor Azure VMs, both Windows
Server and Linux, is to enable what you see in the
screenshot, guest‑level monitoring.
Now, draw your attention to this text that's in the virtual machine
Diagnostic settings blade in the Azure portal that Azure collects host‑level
metrics without you having to do anything, basic ones like CPU utilization,
disk and network usage, and you can go into Azure Monitor, for example, and
plot those live metric values.
However, you probably want to get deeper access into those Windows
Server VMs, Performance Monitor, for example,
Event Viewer. To do that, like I said,
an entry point is to inject the Azure VM diagnostics extension into that VM.
Now that requires a diagnostic storage account because the
diagnostic settings are stored in the blob and table
services of a storage account.
And another benefit of this guest‑level monitoring is that
it's free outside of the cost of the storage that you
consume in your storage account.
However, there's a much better,
more robust way, in my opinion, to do virtual machine
troubleshooting. This is fine, but ultimately you're going to have
to go into the storage account and parse through tables and JSON
files. Ain't nobody got time for that,
especially if you're managing multiple Azure virtual machines. So what we
see in this screenshot is the Extensions + applications blade for an Azure
VM, and I want to draw your attention here.
You see the Microsoft.Insights.VMDiagnosticsSettings.
That's the extension for the IaaS agent,
the guest‑level basic monitoring.
But you'll notice that this particular VM also has something
called the MicrosoftMonitoringAgent on it.
That is also called the Log Analytics agent,
also called the Azure Monitor agent.
And that's the second generation, the next gen of monitoring.
It's what I recommend you use. Now, don't worry too much if your Azure VMs
have both agents. Microsoft has certainly been asked that question a lot in
the past. They don't conflict with each other.
The idea is you could just use the Microsoft Monitoring Agent and use Log
Analytics and not enable the VM diagnostic settings.
But Microsoft says that you might have a better experience when you're plotting
metrics in Azure Monitor when you've got the VM diagnostic settings agent. So,
I tend to install them both and just ignore it.
I have not seen a noticeable performance decrease on those virtual
machines when they have both agents installed.
Lastly, once you enable the guest‑level diagnostic settings,
this is what the interface looks like.
I want you to see it's basic. You have access to performance
counters, and event logs, and crash dump data.
But again, I want to repeat that all of this data is being stored in a
storage account for just this single virtual machine.
So that means being able to report on event logs and performance counters
for multiple Azure virtual machines represents a problem, and this is why we've got Log Analytics.