Enable VM insights in the Azure portal
This article describes how to enable VM insights using the Azure portal for Azure virtual machines, Azure Virtual Machine Scale Sets, and hybrid virtual machines connected with Azure Arc.
Prerequisites
- Log Analytics workspace.
- To enable VM insights for Log Analytics agent, configure your Log Analytics workspace for VM insights. This prerequisite isn't relevant if you're using Azure Monitor Agent.
- See Supported operating systems to ensure that the operating system of the virtual machine or Virtual Machine Scale Set you're enabling is supported.
- See Manage the Azure Monitor agent for prerequisites related to Azure Monitor agent.
View monitored and unmonitored machines
To see which virtual machines in your directory are monitored using VM insights:
From the Monitor menu in the Azure portal, select Virtual Machines > Overview.
The Overview page lists all of the virtual machines and Virtual Machine Scale Sets in the selected subscriptions.
Select the Monitored tab for the list of machines that have VM insights enabled.
Select the Not monitored tab for the list of machines that don't have VM insights enabled.
The Not monitored tab includes all machines that don't have VM insights enabled, even if the machines have Azure Monitor Agent or Log Analytics agent installed. If a virtual machine has the Log Analytics agent installed but not the Dependency agent, it will be listed as not monitored. In this case, Azure Monitor Agent will be started without being given the option for the Log Analytics agent.
Enable VM insights for Azure Monitor Agent
Note
As part of the Azure Monitor Agent installation process, Azure assigns a system-assigned managed identity to the machine if such an identity doesn't already exist.
To enable VM insights on an unmonitored virtual machine or Virtual Machine Scale Set using Azure Monitor Agent:
From the Monitor menu in the Azure portal, select Virtual Machines > Not Monitored.
Select Enable next to any machine that you want to enable. If a machine is currently running, you must start it to enable it.
On the Insights Onboarding page, select Enable.
On the Monitoring configuration page, select Azure Monitor agent and select a data collection rule from the Data collection rule dropdown.
The Data collection rule dropdown lists only rules configured for VM insights. If a data collection rule hasn't already been created for VM insights, Azure Monitor creates a rule with:
- Guest performance enabled.
- Processes and dependencies disabled.
Select Create new to create a new data collection rule. This lets you select a workspace and specify whether to collect processes and dependencies using the VM insights Map feature.
Note
If you select a data collection rule with Map enabled and your virtual machine is not supported by the Dependency Agent, Dependency Agent will be installed and will run in degraded mode.
Select Configure to start the configuration process. It takes several minutes to install the agent and start collecting data. You'll receive status messages as the configuration is performed.
If you use a manual upgrade model for your Virtual Machine Scale Set, upgrade the instances to complete the setup. You can start the upgrades from the Instances page, in the Settings section.
Enable VM insights for Log Analytics agent
To enable VM insights on an unmonitored virtual machine or Virtual Machine Scale Set using Log Analytics agent:
From the Monitor menu in the Azure portal, select Virtual Machines > Overview > Not Monitored.
Select Enable next to any machine that you want to enable. If a machine is currently running, then you must start it to enable it.
On the Insights Onboarding page, select Enable.
On the Monitoring configuration page, select Log Analytics agent.
If the virtual machine isn't already connected to a Log Analytics workspace, then you'll be prompted to select one. If you haven't previously created a workspace, then you can select a default for the location where the virtual machine or Virtual Machine Scale Set is deployed in the subscription. This workspace will be created and configured if it doesn't already exist. If you select an existing workspace, it will be configured for VM insights if it wasn't already.
Note
If you select a workspace that wasn't previously configured for VM insights, the VMInsights management pack will be added to this workspace. This will be applied to any agent already connected to the workspace, whether or not it's enabled for VM insights. Performance data will be collected from these virtual machines and stored in the InsightsMetrics table.
Select Configure to modify the configuration. The only option you can modify is the workspace. You'll receive status messages as the configuration is performed.
If you use a manual upgrade model for your Virtual Machine Scale Set, upgrade the instances to complete the setup. You can start the upgrades from the Instances page, in the Settings section.
Enable Azure Monitor Agent on monitored machines
To add Azure Monitor Agent to machines that are already enabled with the Log Analytics agent:
From the Monitor menu in the Azure portal, select Virtual Machines > Overview > Monitored.
Select Configure using Azure Monitor agent next to any machine that you want to enable. If a machine is currently running, you must start it to enable it.
On the Monitoring configuration page, select Azure Monitor agent and select a rule from the Data collection rule dropdown.
The Data collection rule dropdown lists only rules configured for VM insights. If a data collection rule hasn't already been created for VM insights, Azure Monitor creates a rule with:
- Guest performance enabled.
- Processes and dependencies enabled for backward compatibility with the Log Analytics agent.
Select Create new to create a new data collection rule. This lets you select a workspace and specify whether to collect processes and dependencies using the VM insights Map feature.
Note
Selecting a data collection rule that does not use the Map feature does not uninstall Dependency Agent from the machine. If you do not need the Map feature, uninstall Dependency Agent manually.
With both agents installed, Azure Monitor displays a warning that you may be collecting duplicate data.
Warning
Collecting duplicate data from a single machine with both the Azure Monitor agent and Log Analytics agent can result in the following consequences:
- Additional ingestion cost from sending duplicate data to the Log Analytics workspace.
- The map feature of VM insights may be inaccurate since it does not check for duplicate data.
Once you've verified that the Azure Monitor agent has been enabled, remove the Log Analytics agent from the machine to prevent duplicate data collection.
Next steps
- See Use VM insights Map to view discovered application dependencies.
- See View Azure VM performance to identify bottlenecks, overall utilization, and your VM's performance.
Feedback
Submit and view feedback for