How To Connect An Azure VM To Azure Log Analytics With A VM Extension

In order for a virtual machine to report into Azure Log Analytics it is going to need to have the Log Analytics extension loaded. However if we look at the extension that are available to add to VM in the Azure console there isn’t one listed. In this topic we look at how to add this extension with a few lines of PowerShell. We use the Set-AzureRmVMExtension cmdlet to all the extension and look at the parameters that are required for it. By the end we have a machine with the extension loaded and reporting into Log Analytics.

Prerequisites include: An Azure Subscription. An Azure Log Analytics Workspace. The AzureRM PowerSHell module loaded.