← Back to Articles         
Create an Azure Monitor Alert

Create an Azure Monitor Alert

Published on 20 Oct 2026     6 min read Microsoft AZURE
Azure Alerts

How to Create an Azure Monitor Alert – Step-by-Step 

We will create a simple CPU Usage Alert for an Azure Virtual Machine (VM) using the Azure Portal.

This practical example will help you understand how an alert works, how to configure an Action Group, and how to test the alert.

1. Example Scenario

Suppose you have an Azure Virtual Machine hosting an ASP.NET Core application.

You want Azure to automatically send an email whenever the VM's CPU usage exceeds 80%.

Our Alert Configuration

Setting

Value

Resource

Azure Virtual Machine

Signal

Percentage CPU

Condition

Greater than 80%

Aggregation

Average

Lookback period

5 minutes

Evaluation frequency

1 minute

Severity

2 – Warning

Notification

Email

Alert type

Stateful

Expected behavior: If average CPU usage exceeds 80% during the configured five-minute window, Azure Monitor evaluates the condition and fires an alert. The Action Group sends an email notification.

2. Prerequisites

Before starting, you need:

  1. An active Azure subscription.

  2. An existing Azure Virtual Machine (Windows or Linux).

  3. Permission to create alert rules and Action Groups.

  4. An email address to receive notifications.

Note: You do not need a Log Analytics Workspace or Data Collection Rule for this basic VM CPU metric alert. The VM publishes the Percentage CPU platform metric directly to Azure Monitor.

 

3. Step-by-Step: Create the Alert in Azure Portal

The screenshots below are from Microsoft's Azure Monitor documentation. The portal layout may vary slightly.

Step 1: Open Azure Monitor

  1. Sign in with your Azure account.

  2. In the search bar, type Monitor.

  3. Select Monitor.

  4. From the left navigation menu, select Alerts.

  5. Click + Create → Alert rule.

Alternatively, open your virtual machine and select Monitoring → Alerts → Create → Alert rule. This automatically selects the VM as the resource to monitor.

Microsoft Learn

 

Step 2: Select the Resource (Scope)

The Scope determines which Azure resource you want to monitor.

  1. Open the Scope tab.

  2. Click Select scope, if no resource is already selected.

  3. Select your subscription.

  4. Filter by resource type Virtual machines.

  5. Select your VM, for example vm-demo-01.

  6. Click Apply.

Microsoft Azure Alerts Monitoring Integration | Zenduty Docs
 
 
 

The alert rule will now monitor the selected virtual machine.

Step 3: Configure the Alert Condition

This is the most important step because it determines when Azure fires an alert.

  1. Select the Condition tab.

  2. Click Signal name.

  3. Search for Percentage CPU.

  4. Select the Percentage CPU metric.

Create an activity log, service health, or resource health alert rule - Azure Monitor | Azure Docs
 
 
 

Configure the following values:

Field

Select

Threshold

Static

Aggregation type

Average

Operator

Greater than

Threshold value

80

Check every

1 minute

Lookback period

5 minutes

How does this work?

10:00 AM
CPU = 45%
    |
    v
10:01 AM
CPU = 60%
    |
    v
10:02 AM
CPU = 85%
    |
    v
10:03 AM
CPU = 90%
    |
    v
10:04 AM
CPU = 95%
    |
    v
Average CPU = 75%
    |
    v
75% > 80% ?
    |
    v
NO ALERT

Although CPU usage exceeded 80% at some points, the average across this illustrative five-minute window is only 75%.

If the average exceeds 80%, the condition becomes true and Azure can fire the alert.

Step 4: Create an Action Group

An Action Group defines what Azure should do when the alert fires.

For our example, we want to receive an email.

  1. Select the Actions tab.

  2. Click Select action groups.

  3. Click Create action group.

Enter the following details:

Field

Example

Subscription

Your subscription

Resource group

Your resource group

Action group name

ag-cpu-alert

Display name

CPUAlert

Next, open the Notifications tab.

  1. Click Add notification.

  2. Choose Email/SMS message/Push/Voice.

  3. Select Email.

  4. Enter your email address.

  5. Give the notification a name, such as AdminEmail.

  6. Confirm the notification settings.

Select Review + create, then Create.

Return to the alert rule wizard and make sure ag-cpu-alert is selected.

Step 5: Configure Alert Details

Open the Details tab.

Enter these values:

Field

Example

Alert rule name

High-CPU-Alert

Description

Alert when average CPU exceeds 80%

Severity

2 – Warning

Enable upon creation

Checked

Automatically resolve alerts

Checked

The last option controls whether this metric alert is stateful.

  • Checked: Stateful alert.

  • Unchecked: Stateless alert.

For this example, keep Automatically resolve alerts checked.

Microsoft Learn

 

Step 6: Review and Create

  1. Select Review + create.

  2. Verify the selected resource, condition, and Action Group.

  3. Wait for validation to complete.

  4. Click Create.

Your alert rule is now created.

 

4. How to Test the Azure Alert

You can test the rule without deliberately overloading your VM.

Method 1: Temporarily Lower the CPU Threshold

  1. Open Azure Monitor → Alerts → Alert rules.

  2. Select High-CPU-Alert.

  3. Click Edit.

  4. Open the Condition tab.

  5. Change the threshold from 80 to 1 (or another value below your VM's observed CPU average).

  6. Save the changes.

  7. Wait for the next metric evaluations.

If the VM's average CPU usage exceeds the temporary threshold, the alert should fire.

Example Test Result

CPU average

4.5%

Test threshold

1%

Condition met — alert expected to fire

Illustrative values, not actual VM measurements.

After testing, change the threshold back to 80%.

Method 2: Verify the Email Notification

When the alert fires, the Action Group sends an email to the configured recipient.

The email typically contains information such as:

Azure Monitor Alert

Alert Name : High-CPU-Alert
Severity   : Sev 2
Resource   : vm-demo-01
Metric     : Percentage CPU
Threshold  : Greater than 80%
Condition  : Fired

The exact email format depends on the notification configuration.

Method 3: Verify in Azure Monitor

  1. Open Azure Portal → Monitor.

  2. Select Alerts.

  3. Filter by your subscription and VM.

  4. Select the fired alert.

  5. Inspect its condition, severity, resource, and history.

Azure Automation: Automatic scaling Azure SQL databases based on CPU usage threshold
 
 
 
 

5. Test Stateful vs Stateless Alerts

After creating the alert, you can compare both behaviors by editing the same rule.

Interactive alert behavior example

 
StatefulStateless

CPU stays above 80% during four successive evaluations.

10:05

Fired

10:10

Active

10:15

Active

10:20

Active

One firing for the ongoing incident

The alert remains active and does not repeatedly fire for the same condition.

Conceptual behavior; actual evaluation and notification timing may vary.

6. Common Issues

Issue

Possible reason

Alert not firing

Threshold not met, insufficient metric data, or rule disabled

Email not received

Incorrect Action Group or notification configuration

CPU metric not available

VM recently created; metrics may take time to appear

Alert keeps firing

Stateless mode enabled

Alert not resolving

Recovery criteria not yet met

Unable to create alert

Insufficient Azure RBAC permissions

7. Cleanup After Testing

Azure Monitor metric alert rules can incur charges. When you finish the exercise, delete the test alert if it is no longer needed.

Navigate to Monitor → Alerts → Alert rules, select High-CPU-Alert, and delete it. You can also delete the test Action Group if it is not used elsewhere.

For the official portal screenshots and detailed Microsoft instructions, refer to:

Final result: You have configured a stateful Azure Monitor metric alert that checks VM CPU usage every minute, evaluates the previous five minutes of data, and sends an email through an Action Group when the average exceeds 80%.

← Back to Articles