Redaguoti

Bendrinti naudojant


Enable VM Insights

This article provides details on enabling VM Insights in Azure Monitor using different methods including the Azure portal, ARM templates, and PowerShell script.

Prerequisites

Agents

When you enable VM Insights for a machine, the following agents are installed.

  • Azure Monitor agent: Collects data from the machine and delivers it to a Log Analytics workspace.
  • Dependency agent: Collects discovered data about processes running on the virtual machine and external process dependencies to support the Map feature in VM Insights. This agent is not required for other VM insights functionality, so you don't need to install the dependency agent if you're not going to use the Map feature.

VM insights DCR

Data collection rules (DCRs) are used by the Azure Monitor agent to specify which data to collect and how it should be processed. When you enable VM Insights, you create a DCR specifically for VM insights and associate it with the Azure Monitor agent on any machines to monitor.

The only configuration in a VM insights DCR is the Log Analytics workspace and whether or not to collect processes and dependencies data. Instead of creating a separate DCR for each machine, you should use a single DCR for each Log Analytics workspace you use for VM insights and associate that DCR with multiple machines. You may want to create separate DCRs if you want to collect processes and dependencies from some machines but not from others.

You shouldn't modify the VM insights DCR. If you need to collect additional data from the monitored machines, such as event logs and security logs, create additional DCRs and associate them with the same machines. You can get guidance for creating these DCRs from Collect data with Azure Monitor Agent.

Diagram showing the operation of VM insights DCR compared to other DCRs associated with the same agents.

Create a VM insights DCR

There are two methods to create a VM insights DCR. Regardless of the method you choose, the DCR is identical and can be used with any process to enable VM insights on other machines. While not required, you should name the DCR MSVMI-{WorkspaceName} to match the naming convention used by the Azure portal.

  • Create a VM insights DCR as part of the onboarding process using the Azure portal with the process detailed below.

  • Download and install the VM insights data collection rule templates. The following table describes the templates available. See Deploy templates if you aren't familiar with methods to deploy ARM templates.

    Folder File Description
    DeployDcr\
    PerfAndMapDcr
    DeployDcrTemplate
    DeployDcrParameters
    Enable both Performance and Map experience of VM Insights.
    DeployDcr\
    PerfOnlyDcr
    DeployDcrTemplate
    DeployDcrParameters
    Enable only Performance experience of VM Insights.

By default, Azure Monitor Agent connects to a public endpoint to connect to your Azure Monitor environment. To enable network isolation for VM Insights, associate your VM Insights DCR to a data collection endpoint (DCE) linked to an Azure Monitor Private Link Scope as described in Enable network isolation for Azure Monitor Agent by using Private Link.

Enable VM insights

Enable VM insights using the Azure portal

Use the following procedure to enable VM insights on an unmonitored virtual machine or Virtual Machine Scale Set. This process doesn't require you to deploy agents or create a VM insights DCR first since these tasks are performed by the portal.

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.

  1. From the Monitor menu in the Azure portal, select Virtual Machines > Not Monitored. This tab includes all machines that don't have VM insights enabled. Any machines have Azure Monitor agent installed. If a virtual machine has the Log Analytics agent installed but not the Dependency agent, it will be listed as not monitored.

  2. Select Enable next to any machine that you want to enable. If a machine is currently not 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 DCR from the Data collection rule dropdown. Only DCRs configured for VM insights are listed.

    Screenshot of VM Insights Monitoring Configuration Page.

  5. If a DCR hasn't already been created for VM insights, Azure Monitor offers to create one with a default Log Analytics workspace and the following settings. You can either accept these defaults or click Create New to create a new DCR with different settings. This lets you select a workspace and specify whether to collect processes and dependencies using the VM insights Map feature.

    • Guest performance enabled.
    • Processes and dependencies disabled.

    Screenshot showing screen for creating new data collection rule.

    Note

    If you select a DCR 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.

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

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

Next steps

To learn how to use the Performance monitoring feature, see View VM Insights Performance. To view discovered application dependencies, see View VM Insights Map.