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.

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 are designed to monitor your entire set of Azure and hybrid virtual machines in a single interface. When you start monitoring multiple virtual machines in your Azure environment, you might want to consider enabling VM insights for the following features:

  • Simplified onboarding of the Log Analytics agent and the Dependency agent, so that you can monitor a virtual machine guest operating system and workloads.
  • 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 quick steps for configuring VM insights and enabling monitoring for a virtual machine, see Enable Azure Monitor for a single virtual machine or virtual machine scale set in the Azure portal.

For general information about enabling insights and a variety of methods for onboarding virtual machines, see Enable VM insights overview.

Collect guest metrics and logs

Azure Monitor starts automatically collecting metric data for your virtual machine host when you create the VM. To collect metrics from the guest operating system of the virtual machine, though, you must install an agent. When you enable VM insights, the Log Analytics agent is installed and starts sending performance data to Azure Monitor Logs, which then enables the Performance and Map views. For a tutorial on enabling VM insights for a virtual machine, see Enable monitoring for Azure virtual machines.

After you've enabled VM insights, install the Azure Monitor agent so that you can collect guest logs from your virtual machine and send guest metrics to the Azure Monitor Metrics pane. By doing so, you can also analyze metrics on the Metrics pane. 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 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

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 store the collected data 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.

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.