1. Home
  2. Training Library
  3. Microsoft Azure
  4. Courses
  5. Getting Started with Azure Virtual Machines

Monitoring and Autoscaling

Start course

Microsoft Azure is one of the key platforms currently serving the cloud computing market. Since its launch in 2010, it has quickly matured, adding whole categories of critical services, including the flagship "Azure Virtual Machines" - an IaaS computing platform.

In this course, our Azure expert Ganapathi Subramanian will introduce the Azure Virtual Machine service and its features, focusing on Azure Windows and Linux virtual machines using Azure portal and powershell scripts, creating and managing custom Azure virtual machine images, configuring Azure virtual machines for high availability, understanding Azure virtual machine networking features, and configuring Azure virtual machine for monitoring and auto-scaling.

If you're not yet familiar with the platform, you might gain by taking Ganapathi's Introduction to Microsoft Azure before starting this course.

Do you have questions on this course? Contact our cloud experts in our community forum.


In this lecture, we'll learn how azure virtual machines can be monitored. We'll also cover enabling the autoscaling feature for virtual machines. This diagram shows that monitoring architecture for Azure virtual machines. The Azure diagnostic monitoring framework is responsible for collecting metrics regarding virtual machine health. Diagnostics can be configured to collect monitoring data such as CPU usage, memory usage and performance counters data. The diagnostics monitor collects the metrics data and stores them in standard Windows data sources like event logs and log files.

Setup Azure diagnostic monitoring


Azure diagnostic monitoring framework is also responsible for moving the data from the standard Windows data sources to a specified Azure storage account at a specified interval. Once the monitoring data is available in Azure storage, monitoring tools can be used to configure alerts and notifications. An Azure virtual machine can be monitored using a VM agent, which gets installed during the provisioning process. The VM agent is responsible for configuring the diagnostic monitor for collecting monitoring data.

Which monitoring data is to be collected can be configured using the Azure portal. The Azure portal supports configuring basic monitoring data. It can also be extended to collect additional monitoring data. Once the metrics data are configured, the monitoring data can be viewed in a portal using the chart feature. The monitoring data can also be viewed in its raw format by accessing the associated storage account. Many third-party tools have extended Azure's monitoring architecture and add it to the monitoring system. Some of the popular ones include MetricsHub, a third-party tool acquired by Microsoft and available as an add-on to Azure portal. AzureWatch, a monitoring tool which can be used to collect key monitoring data, has a license fee associated for using this tool.

AppDynamics, a third-party application performance manage tool, which is integrated with Azure. Azure's auto-scaling feature can be leveraged to scale virtual machine instances. Virtual machines to be scaled are created within a cloud service and availability set. To configure auto-scaling, you need to pre-create the maximum number of virtual machines to support the peak load. Once the maximum numbers of virtual machines are created, auto-scaling is configured using the Cloud services associated with it.

Auto-scaling policies are configured using the auto-scaling configuration for cloud services. Once the auto-scaling is configured, Azure will manage the instances in scaling as it will automatically stop and restart the instances based on auto-policy rules. In this demo, we'll see how a virtual machine can be configured for monitoring. Let's create a virtual machine using the portal. We need to make sure that the VM agent is installed in this virtual machine. Basic monitoring data for the virtual machines can be viewed in the Azure portal by selecting the monitoring table on the virtual machine. Custom monitoring configuration is available only as part of the new Azure portal. Let's switch to this new portal for this demo.

How to configure Azure autoscaling using Azure

Let's select the virtual machine and enable Azure monitoring by selecting the diagnostics option. The next step is to configure the metrics for data collection. After enabling the diagnostics, select the metrics that need to be collected in the resulting screen. Once the metrics configuration is complete, select the Virtual Machine and click on the Edit Chart option. Select the time range and metrics to display to view the monitoring data. The monitoring data can also be viewed from the storage account. In this demo, we'll see how virtual machines are configured for auto-scaling. Let's create four virtual machines under the same cloud service and availability sets. Go to the cloud service associated with the virtual machine and click on the Scale tab. Select the Availability set for which you need to configure the auto-scaling.

Select the metrics in which the autoscaling needs to happen. For example, CPU usage and the maximum and minimum number of instances. We'll also configure the auto-scaling schedule, save the settings to start the auto-scaling process. Let's monitor the virtual machines instances for the auto-scaling behavior. As you can see, based on the schedule and metrics, auto-scaling automatically adjusts the number of instances. Azure virtual machines are based on the infrastructure as a service IAAS model. The users who create the virtual machine are responsible for managing the virtual machine. Managing the virtual machine includes tasks such as schedule maintenance, patching and upgrading. Vendors like Rackspace provide a managed services framework for Azure virtual machines, which can be leveraged from management.

The management services framework is a set of automated scripts to perform various maintenance tasks on virtual machines.

About the Author

Trevor Sullivan is a Microsoft MVP for Windows PowerShell, and enjoys working with cloud and automation technologies. As a strong, vocal veteran of the Microsoft-centric IT field since 2004, Trevor has developed open source projects, provided significant amounts of product feedback, authored a large variety of training resources, and presented at IT functions including worldwide user groups and conferences.