Sometimes there are lots of VM in your subscriptions, it needs take long time to enable VM Insights in the Azure Portal.
You can view this blog to see how to get use of PowerShell script to enable all the VM with VM Insights to save your time.
- Networking Connectivity
Please ensure customer network allowing below internet outbound from the VM.
- Log Analytics Workspace
Please create at least one log analytics workspace for log storing.
- PowerShell Module
Please ensure your PowerShell have installed the latest module with Enable-AzureRM feature.
You may reference from here.
- PowerShell Script
Please save the attached PowerShell script to your computer.
- Open the Install-VMInsights-parameter.
- Set the path that you save the Install-VMInsights.ps1
- Set the parameter.
- Tenant ID
- Subscription ID
- Workspace ID
- Workspace Key
- Workspace Region
- Resource Group Name (Optional)
*If you set the resource group name, the scope will be that specific resource group, rather than subscription.
- Open PowerShell as an administrator.
- Copy and run the script.
- It will list out all VM in the scope and require your confirmation.
- Press Y to confirm and it will start the installation.
- If there are any failed installation, it may cause by network connectivity or the OS compatibility. Please double check and confirm.
- VM Insight Agent upgrade
After the installation, we need to access the Azure portal and upgrade the agent.
- Go to Azure portal and open monitor
- Click Virtual Machine.
- You are able to see the VM insight agent status from here.
- If you confirm the machine are show as monitored, please select all and click Upgrade selected.
4. It will show a list to you.
- Click Upgrade to continue.
- When all process finishes, you may able to see the Monitor Coverage is Enabled and Guest VM Health is Healthy.
You can visit our SOS GitHub for downloading the source code as a template: