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.

Note

Azure portal no longer supports enabling VM insights using the legacy Log Analytics agent.

Prerequisites

View monitored and unmonitored machines

To see which virtual machines in your directory are monitored using VM insights:

  1. 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.

  2. Select the Monitored tab for the list of machines that have VM insights enabled.

  3. 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:

  1. From the Monitor menu in the Azure portal, select Virtual Machines > Not Monitored.

  2. Select Enable next to any machine that you want to enable. If a machine is currently running, you must start it to enable it.

    Screenshot with unmonitored machines in V M insights.

  3. On the Insights Onboarding page, select Enable.

  4. On the Monitoring configuration page, select Azure Monitor agent and select a data collection rule from the Data collection rule dropdown. Screenshot of VM Insights Monitoring Configuration Page.

  5. 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.
  6. 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.

    Screenshot showing screen for creating new data collection rule.

    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.

  7. 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.

  8. 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 Azure Monitor Agent on machines monitored with Log Analytics agent

To add Azure Monitor Agent to machines that are already enabled with the Log Analytics agent:

  1. From the Monitor menu in the Azure portal, select Virtual Machines > Overview > Monitored.

  2. 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.

    Screenshot showing monitoring configuration to Azure Monitor agent to monitored machine.

  3. On the Monitoring configuration page, select Azure Monitor agent and select a rule from the Data collection rule dropdown. Screenshot of VM Insights Agent Configuration Page.

  4. 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.
    1. 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.

    2. With both agents installed, Azure Monitor displays a warning that you may be collecting duplicate data.

      [Screenshot showing warning message for both agents installed] Screenshot showing warning message for both agents installed.

      Warning

      Collecting duplicate data from a single machine with both the Azure Monitor agent and Log Analytics agent can result in:

      • Additional cost of ingestion duplicate data to the Log Analytics workspace.
      • The map feature of VM insights may be inaccurate since it does not check for duplicate data. For more information about
  5. 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