This post was originally published to Martynas' personal cloud blog MagicMarty.eu. You can read it here.
Azure provides easy way to deploy Operations Management Suite (OMS) agents on Azure VMs. All you need to do is to navigate to Log Analytics blade, choose Virtual Machines from Data Sources and select which VMs you want to add to OMS workspace by clicking Connect on the VM.
But what if you have hundreds or even thousands of VMs running on Azure? This is not going to be an easy task to click on each VM and connect to OMS workspace. Powershell is the answer! With the code below you will be in a good shape to deploy OMS extensions to all VMs on all Resource Groups in your subscription.
Powershell script to deploy OMS monitoring extensions:
Elastabytes are a cloud managed services company specialising in SQL Server. We’re a Microsoft Gold Partner and our team is made of Microsoft MVPs. Whether you’re already in Azure and need a DBA-as-a-Service, or you’re about to go to Azure and need a hand getting there, Elastabytes can help.
Contact us at firstname.lastname@example.org to set up a chat with one of our architects.