Monitor Azure virtual machines

When you have critical applications and business processes that rely on Azure resources, it's important to monitor those resources for their availability, performance, and operation. This article describes the monitoring data that's generated by Azure virtual machines (VMs), and it discusses how to use the features of Azure Monitor to analyze and alert you about this data.

Note

This article provides basic information to help you get started with monitoring your VMs. For a complete guide to monitoring your entire environment of Azure and hybrid virtual machines, see Monitor virtual machines with Azure Monitor.

What is Azure Monitor?

Azure Monitor is a full stack monitoring service that provides a complete set of features to monitor your Azure resources. You don't need to directly interact with Azure Monitor, though, to perform a variety of monitoring tasks, because its features are integrated with the Azure portal for the Azure services that it monitors. For a tutorial with an overview of how Azure Monitor works with Azure resources, see Monitor Azure resources by using Azure Monitor.

Monitoring virtual machine data

Azure virtual machines collect the same kinds of monitoring data as other Azure resources, which are described in Monitoring data from Azure resources. For detailed information about the metrics and logs that are created by Azure virtual machines, see Reference: Monitoring Azure virtual machine data.

Overview page

To begin exploring Azure Monitor, go to the Overview page for your virtual machine, and then select the Monitoring tab. You can see the number of active alerts on the tab.

The Alerts pane shows you the alerts fired in the last 24 hours, along with important statistics about those alerts. If there are no alerts configured for your VM, there is a link to help you quickly create new alerts for your VM.

Screenshot of the Azure virtual machine 'Alerts' pane.

The Key Metrics pane includes charts that show key health metrics, such as average CPU and network utilization. At the top of the pane, you can select a duration to change the time range for the charts, or select a chart to open the Metrics pane to drill down further or to create an alert rule.

Screenshot of the Azure virtual machine 'Key metrics' pane.

Activity log

The Activity log displays recent activity by the virtual machine, including any configuration changes and when it was stopped and started. View the Activity log in the Azure portal, or create a diagnostic setting to send it to a Log Analytics workspace, where you can view events over time or analyze them with other collected data.

Screenshot of the 'Activity log' pane.

Azure Monitor agent

Azure Monitor starts automatically collecting metric data for your virtual machine host when you create the VM. To collect logs and performance data from the guest operating system of the virtual machine, though, you must install the Azure Monitor agent. You can install the agent and configure collection using either VM insights or by creating a data collection rule as described below.

VM insights

Some services in Azure display customized monitoring experiences in Azure Monitor. These experiences are called insights, and they include pre-built workbooks and other specialized features for that particular service.

VM insights is designed to monitor your Azure and hybrid virtual machines in a single interface. VM insights provides the following benefits beyond other features for monitoring VMs in Azure Monitor:

  • Simplified onboarding of the Azure Monitor agent and the Dependency agent, so that you can monitor a virtual machine guest operating system and workloads.
  • Pre-defined data collection rules that collect the most common set of performance data.
  • Pre-defined trending performance charts and workbooks, so that you can analyze core performance metrics from the virtual machine's guest operating system.
  • The Dependency map, which displays processes that run on each virtual machine and the interconnected components with other machines and external sources.

Screenshot of the VM insights 'Logical Disk Performance' view.

Screenshot of the VM insights 'Map' view.

For a tutorial on enabling VM insights for a virtual machine, see Enable monitoring with VM insights for Azure virtual machine. For general information about enabling insights and a variety of methods for onboarding virtual machines, see Enable VM insights overview.

Create data collection rule

If you enable VM insights, the Azure Monitor agent is installed and starts sending a predefined set of performance data to Azure Monitor Logs. You can create additional data collection rules to collect events and other performance data. To learn how to install the Azure Monitor agent and create a data collection rule that defines the data to collect, see Tutorial: Collect guest logs and metrics from an Azure virtual machine.

Analyze metrics

Metrics are numerical values that describe some aspect of a system at a particular point in time. Although platform metrics for the virtual machine host are collected automatically, you must install the Azure Monitor agent and create a data collection rule to collect guest metrics.

The Overview pane includes the most common host metrics, and you can access others by using the Metrics pane. With this tool, you can create charts from metric values and visually correlate trends. You can also create a metric alert rule or pin a chart to an Azure dashboard. For a tutorial on using this tool, see Analyze metrics for an Azure resource.

Screenshot of the 'Metrics' pane in Azure Monitor.

For a list of the available metrics, see Reference: Monitoring Azure virtual machine data.

Analyze logs

Event data in Azure Monitor Logs is stored in a Log Analytics workspace, where it's separated into tables, each with its own set of unique properties.

VM insights stores the data it collects in Logs, and the insights provide performance and map views that you can use to interactively analyze the data. You can work directly with this data to drill down further or perform custom analyses. For more information and to get sample queries for this data, see How to query logs from VM insights.

To analyze other log data that you collect from your virtual machines, use log queries in Log Analytics. Several built-in queries for virtual machines are available to use, or you can create your own. You can interactively work with the results of these queries, include them in a workbook to make them available to other users, or generate alerts based on their results.

Screenshot of the 'Logs' pane displaying Log Analytics query results.

Alerts

Azure Monitor alerts proactively notify you when important conditions are found in your monitoring data. These alerts can help you identify and address issues in your system before your customers notice them. You can set alerts on metrics, logs, and the activity log.

Start by enabling recommended alerts. These are a predefined set of alert rules based on host metrics for the VM. You can quickly enable and customize each of these rules with a few clicks in the Azure portal. See Tutorial: Enable recommended alert rules for Azure virtual machine. This includes the VM availability metric which alerts when the VM stops running.

Multi-resource metric alerts

Using recommended alerts, a separate alert rule is created for each VM. You can choose to instead use a multi-resource alert rule to use a single alert rule that applies to all VMs in a particular resource group or subscription (within the same region). See Create availability alert rule for Azure virtual machine (preview) for a tutorial using the availability metric.

Other alert rules

For more information about the various alerts for Azure virtual machines, see the following resources:

Next steps

For documentation about the logs and metrics that are generated by Azure virtual machines, see Reference: Monitoring Azure virtual machine data.