Configure Virtual Machine Monitoring in Azure

1 hour
  • 3 Learning Objectives

About this Hands-on Lab

Azure Monitor is a suite of services and features within Azure, which provides various monitoring capabilities. It is possible to monitor Azure resources, subscriptions, and an Azure AD tenant.

In this hands-on lab, you will gain experience configuring monitoring for a Virtual Machine, using Azure Monitor Logs (also known as Log Analytics).

By the end of this lab, you’ll be able to configure a Virtual Machine to send metrics and log data to a Log Analytics Workspace.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Log Analytics Workspace

Use the Azure Portal to create a new Log Analytics workspace.

  1. Click on + Create a resource option in the sidebar menu.
  2. Search for "log analytics workspace" and select the option that appears.
  3. Click on Create to create a new Log Analytics Workspace.

Create the workspace with the following details:

  1. Fill out the Basics page:
    • Subscription:* select the Hands-On Labs subscription
    • Resource Group:* select the existing resource group
    • Name:* Create a unique name like, ‘lablog123’
    • Region:* Use the same region as the existing resources
  2. Click on Next.
  3. Fill out the Pricing tier
    • Pricing tier:* Pay-as-you-go
  4. Click on Review + Create.
  5. Click on Create.
Connect VM1 to Log Analytics

Use the Azure Portal to create a new Log Analytics workspace.

  1. Navigate to the Log Analytics workspace, you just created.
  2. Click on ‘Virtual machines‘ within the ‘Workspace Data Sources’ section of the resource menu.
  3. Click on ‘vm1‘.
  4. Click ‘Connect‘.
(OPTIONAL) Verify Virtual Machine Monitoring

NOTE: You may choose to perform the following tasks, to help understand and verify that virtual machine monitoring is working.

This is an optional activity and is not required to enable virtual machine monitoring.

The following information shows key areas of virtual machine monitoring, and what you can expect to see in each section.

  • VM Extensions:
    • Navigate to VM1 on then click Extensions.
    • You should expect to see the MicrosoftMonitoringAgent installed.
  • Log Queries:
    • Navigate to the Log Analytics workspace created earlier, and then click Logs.
    • You should expect to see several sample queries, such as computer availability.
  • Workbooks
    • Navigate to the Log Analytics workspace created earlier, and then click Workbooks.
    • You should expect to see workbooks such as Agent Health which will show information for vm1.

Additional Resources

You work as a systems administrator for The Pupper Camp. The Pupper Camp is a dog services company that operates across the globe.

The Pupper Camp currently has a range of infrastructure hosted both within Azure and on-premises. An audit has recently been performed on both your on-premises and Azure environment.

The audit has found that monitoring is not enabled for existing virtual machines within Azure. You have been tasked with configuring Log Analytics, knowing that it will be capable of monitoring The Pupper Camp's on-premises servers, as well as those within Azure.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?