Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
I was asked by a customer to add the OMS client to an Azure VM ScaleSet (VMSS). This is not documented directly for a VMSS, though it is for Azure VMs. After some asking around and some experimentation, I was able to successfully deploy the OMS agent to the VMSS using the following PowerShell:
select-azurermsubscription -subscriptionid ‘your subscription id’ $PublicSettings = @{"workspaceId" = "your oms workspace id"} $ProtectedSettings = @{"workspaceKey" = "your big base64 oms key"} # Get information about the scale set $vmss = Get-AzureRmVmss -ResourceGroupName 'VMSSRESOURCEGROUP' ` -VMScaleSetName 'VMSSNAME' Add-AzureRmVmssExtension ` -VirtualMachineScaleSet $vmss ` -Name "Microsoft.EnterpriseCloud.Monitoring" ` -Publisher "Microsoft.EnterpriseCloud.Monitoring" ` -Type "MicrosoftMonitoringAgent" ` -TypeHandlerVersion 1.0 ` -AutoUpgradeMinorVersion $true ` -Setting $PublicSettings ` -ProtectedSetting $ProtectedSettings # Update the scale set and apply the Custom Script Extension to the VM instances Update-AzureRmVmss ` -ResourceGroupName $vmss.ResourceGroupName ` -Name $vmss.Name ` -VirtualMachineScaleSet $vmss # Only needed for manual update VMSS – warning tells them all to update, so modify to suit $jobs=@() Get-AzureRmVmssVM -ResourceGroupName $vmss.ResourceGroupName -VMScaleSetName $vmss.Name | foreach { $jobs+=Update-AzureRmVmssInstance -ResourceGroupName $vmss.ResourceGroupName -Name $vmss.Name -InstanceId $_.InstanceId -AsJob } $jobs | Wait-Job $jobs | Receive-Job
References Azure VMSS Azure Operations Management Suite (OMS)
Azure VM OMS Agent
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in