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 for getting started monitoring an Azure Virtual Machine.

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.

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.

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.

Next steps

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