Challenge 02 - Setting up Monitoring via Automation

< Previous Challenge - Home - Next Challenge >

Introduction

There are multiple ways to configure monitoring in Azure. You can configure monitoring manually in the Azure portal like you did in the previous challenge. This is a great way to learn how Azure Monitor works and what settings are available to choose from. However, this method does not scale when you need to configure monitoring across 10s, 100s, or even 1000s of resources in Azure. It is easier to configure monitoring at scale across many Azure resources if you use a declarative Infrastructure-as-Code tool such as ARM templates, Bicep, or Terraform. In addition to that, you can use Azure Policies to ensure that all newly created VMs in the defined scope get required agents installed and all cloud native resources send diagnostics to Azure Monitor (Azure Policies will be explored in the next Challenge).

For this challenge, you will deploy several Metric alerts for your VMs, but this time you will use Bicep templates instead of the Azure Portal. You will get familiar with a new type of alerts - Activity log alert. The Azure Monitor Activity log is a platform log in Azure that provides insight into subscription-level events. The activity log includes information like when a resource is modified or a virtual machine is started.

You will also be asked to install the Azure Monitor Agent on the Virtual Machine Scale Set (VMSS) and configure new Data Collection Rules (DCRs) by using an Infrastructure-as-Code approach.

Description

You can find sample Bicep files, alert.bicepand ama.bicep, in the Challenge-02 folder of the student resource package. To complete the challenge, navigate to the location of these files using your terminal client (WSL or Azure Cloud Shell).

In this challenge you need to complete the following management tasks:

HINT: Use the “Percentage CPU” Metric alert rule that you deployed earlier as an example.

Bonus questions:

Success Criteria

To complete this challenge successfully, you should be able to:

Learning Resources