Manage Azure VMs with OMS

Microsoft Operations Management Suite

The new Compute, Network and Storage Providers under the Azure Resource Managers allow organizations to create VMs and effectively manage them; the new Compute Resource Provider (CRP) brings new capabilities like the ability to template a VM using a JSON template,Azure Resource Managers allow organizations to create and effectively manage Azure Resources; the new Compute Resource Provider (CRP) brings new capabilities like the ability to template a VM using a JSON templateAzure Resource Managers allow organizations to create and effectively manage Azure Resources; the new Compute Resource Provider (CRP) brings new capabilities like the ability to template a VM using a JSON template, secure your resource groups with role based access security or tag your VMs.

And guess what! Even though it is not very well documented, you can manage your IaaS VMs v2 with Microsoft Operations Management Suite. The Poweshell snippet below shows how you can add the OMS agent to Azure VMS v2.

Add OMS Agent with Powershell

Switch-AzureMode -Name AzureResourceManager
	$workspaceId="GET THIS FROM OMS PORTAL"
	$workspaceKey="GET THIS FROM OMS PORTAL"
	$resourceGroupName="dcdev" 
	$vm = Get-AzureVM -ResourceGroupName $resourceGroupName
	$vm | Set-AzureVMExtension -VMName {$_.Name} -ExtensionType "MicrosoftMonitoringAgent" `
             -Publisher 'Microsoft.EnterpriseCloud.Monitoring' -Name "OMS" -Location "West Europe"  `
             -Version '1.0' -SettingString "{'workspaceId': '$workspaceId'}"  `
             -ProtectedSettingString "{'workspaceKey': '$workspaceKey' }" `
             -ResourceGroupName $resourceGroupName

Share this Post