Lesson 4 of 5 Azure Monitoring Tools

Responding to Conditions with Azure Monitor Alerts

This lesson explains Azure Monitor alerts: alert rules, signal types, severities and action groups.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the parts of an alert rule.
  • Identify the signal types that alerts can use.
  • Describe the purpose of action groups.

What alerts do

Azure Monitor alerts are an automated way to stay informed when Azure Monitor detects a threshold being crossed. You set the alert conditions, the notification actions, and then Azure Monitor notifies you when an alert is triggered. Depending on your configuration, Azure Monitor alerts can also attempt corrective action, such as restarting a service or scaling out, through automation.

An alert is defined by an alert rule, which combines three things.

PartWhat it definesExample
Scope (target resource)The resources to monitorA VM, all VMs in a resource group, a subscription
ConditionThe signal and logic that trigger the alertAverage CPU above 85% for 15 minutes
ActionsWhat happens when the alert fires, through action groupsEmail the operations team and run an automation runbook

Each alert rule also has a severity, from 0 (critical) to 4 (verbose), which helps people prioritize.

Match the pairs

Parts of an alert rule

Exam skills 3.4.3

Match each part of an alert rule with an example.

Log in to try this activity Interactive activities are free with an account.

Signal types

Alert rules can be based on several types of monitoring data:

  • Metric alerts: evaluate a metric at regular intervals, such as CPU percentage or response time, and fire when it crosses a static threshold or a dynamic threshold that Azure learns from history.
  • Log search alerts: run a KQL query against a Log Analytics workspace on a schedule and fire when the results meet a condition, such as more than ten errors in five minutes.
  • Activity log alerts: fire when a specific subscription event occurs, such as a resource being deleted or a role assignment being created. Service Health alerts and Resource Health alerts are activity log alerts for health events.
  • Smart detection alerts from Application Insights warn about potential performance problems and failure anomalies in web applications.
Sort into groups

Which alert signal?

Exam skills 3.4.3

Choose the alert signal type for each requirement.

Log in to try this activity Interactive activities are free with an account.

Action groups

Action groups define who to notify and what to do when an alert is triggered. An action group is a reusable collection of notification preferences and actions, so many alert rules can use the same group. Notifications include email, SMS messages, push notifications to the Azure mobile app and voice calls. Actions include running an Azure Automation runbook, an Azure Function or a Logic Apps workflow, calling a webhook, and creating tickets in IT service management (ITSM) tools.

Alerts follow a lifecycle: a fired alert has a monitor condition that becomes resolved when the condition clears, and a user-set alert state (New, Acknowledged or Closed) that tracks how people are handling it.

Worked example

Alerting on a deletion and on performance

A company wants its operations team to receive an email and an SMS message whenever anyone deletes a resource in the production resource group, and also when the average CPU of its web server VMs stays above 90% for ten minutes. How should the alerts be configured?

Create an action group that sends email and SMS to the operations team. Then create an activity log alert scoped to the production resource group for delete operations, and a metric alert on the VMs' Percentage CPU with an average above 90% over ten minutes, and attach the same action group to both rules. Azure Advisor alerts notify about new recommendations, not about deletions or CPU levels.

Check yourself

What is the purpose of an action group?

Show answer

It defines who to notify and what automation to run when an alert fires, and many alert rules can reuse it.

Exam Tips

Remember for the exam

  • An alert rule has a scope, a condition and actions; severity ranges from 0 (critical) to 4.
  • Signal types: metrics, log search queries, activity log events (including Service Health), smart detection.
  • Action groups notify people (email, SMS, push, voice) and trigger automation (runbooks, functions, webhooks).