Configure Azure Alert Processing Rules

The azure-native:alertsmanagement:AlertProcessingRuleByName resource, part of the Pulumi Azure Native provider, defines alert processing rules that route alerts to action groups or suppress notifications based on conditions and schedules. This guide focuses on three capabilities: action group routing, conditional filtering by severity and resource type, and maintenance window scheduling.

Alert processing rules reference action groups and Azure resources that must exist separately. The examples are intentionally small. Combine them with your own action groups, alert rules, and resource scopes.

Route all alerts to an action group

Most alert processing rules start by routing alerts to notification channels, ensuring consistent notification behavior across a subscription.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertProcessingRuleByName = new azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName", {
    alertProcessingRuleName: "AddActionGroupToSubscription",
    location: "Global",
    properties: {
        actions: [{
            actionGroupIds: ["/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1"],
            actionType: "AddActionGroups",
        }],
        description: "Add ActionGroup1 to all alerts in the subscription",
        enabled: true,
        scopes: ["/subscriptions/subId1"],
    },
    resourceGroupName: "alertscorrelationrg",
    tags: {},
});
import pulumi
import pulumi_azure_native as azure_native

alert_processing_rule_by_name = azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName",
    alert_processing_rule_name="AddActionGroupToSubscription",
    location="Global",
    properties={
        "actions": [{
            "action_group_ids": ["/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1"],
            "action_type": "AddActionGroups",
        }],
        "description": "Add ActionGroup1 to all alerts in the subscription",
        "enabled": True,
        "scopes": ["/subscriptions/subId1"],
    },
    resource_group_name="alertscorrelationrg",
    tags={})
package main

import (
	alertsmanagement "github.com/pulumi/pulumi-azure-native-sdk/alertsmanagement/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := alertsmanagement.NewAlertProcessingRuleByName(ctx, "alertProcessingRuleByName", &alertsmanagement.AlertProcessingRuleByNameArgs{
			AlertProcessingRuleName: pulumi.String("AddActionGroupToSubscription"),
			Location:                pulumi.String("Global"),
			Properties: &alertsmanagement.AlertProcessingRulePropertiesArgs{
				Actions: pulumi.Array{
					alertsmanagement.AddActionGroups{
						ActionGroupIds: []string{
							"/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1",
						},
						ActionType: "AddActionGroups",
					},
				},
				Description: pulumi.String("Add ActionGroup1 to all alerts in the subscription"),
				Enabled:     pulumi.Bool(true),
				Scopes: pulumi.StringArray{
					pulumi.String("/subscriptions/subId1"),
				},
			},
			ResourceGroupName: pulumi.String("alertscorrelationrg"),
			Tags:              pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var alertProcessingRuleByName = new AzureNative.AlertsManagement.AlertProcessingRuleByName("alertProcessingRuleByName", new()
    {
        AlertProcessingRuleName = "AddActionGroupToSubscription",
        Location = "Global",
        Properties = new AzureNative.AlertsManagement.Inputs.AlertProcessingRulePropertiesArgs
        {
            Actions = new[]
            {
                new AzureNative.AlertsManagement.Inputs.AddActionGroupsArgs
                {
                    ActionGroupIds = new[]
                    {
                        "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1",
                    },
                    ActionType = "AddActionGroups",
                },
            },
            Description = "Add ActionGroup1 to all alerts in the subscription",
            Enabled = true,
            Scopes = new[]
            {
                "/subscriptions/subId1",
            },
        },
        ResourceGroupName = "alertscorrelationrg",
        Tags = null,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByName;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByNameArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.AlertProcessingRulePropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertProcessingRuleByName = new AlertProcessingRuleByName("alertProcessingRuleByName", AlertProcessingRuleByNameArgs.builder()
            .alertProcessingRuleName("AddActionGroupToSubscription")
            .location("Global")
            .properties(AlertProcessingRulePropertiesArgs.builder()
                .actions(AddActionGroupsArgs.builder()
                    .actionGroupIds("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1")
                    .actionType("AddActionGroups")
                    .build())
                .description("Add ActionGroup1 to all alerts in the subscription")
                .enabled(true)
                .scopes("/subscriptions/subId1")
                .build())
            .resourceGroupName("alertscorrelationrg")
            .tags(Map.ofEntries(
            ))
            .build());

    }
}
resources:
  alertProcessingRuleByName:
    type: azure-native:alertsmanagement:AlertProcessingRuleByName
    properties:
      alertProcessingRuleName: AddActionGroupToSubscription
      location: Global
      properties:
        actions:
          - actionGroupIds:
              - /subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1
            actionType: AddActionGroups
        description: Add ActionGroup1 to all alerts in the subscription
        enabled: true
        scopes:
          - /subscriptions/subId1
      resourceGroupName: alertscorrelationrg
      tags: {}

When an alert fires within the specified scopes, the rule adds the action group to the alert’s notification list. The actions array defines what happens (AddActionGroups), actionGroupIds lists the action groups to notify, and scopes determines which alerts the rule applies to. Setting enabled to true activates the rule immediately.

Filter alerts by severity and scope

Teams often need different notification behavior for critical alerts, routing high-priority incidents to multiple action groups.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertProcessingRuleByName = new azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName", {
    alertProcessingRuleName: "AddActionGroupsBySeverity",
    location: "Global",
    properties: {
        actions: [{
            actionGroupIds: [
                "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1",
                "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2",
            ],
            actionType: "AddActionGroups",
        }],
        conditions: [{
            field: azure_native.alertsmanagement.Field.Severity,
            operator: azure_native.alertsmanagement.Operator.Equals,
            values: [
                "sev0",
                "sev1",
            ],
        }],
        description: "Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups",
        enabled: true,
        scopes: [
            "/subscriptions/subId1/resourceGroups/RGId1",
            "/subscriptions/subId1/resourceGroups/RGId2",
        ],
    },
    resourceGroupName: "alertscorrelationrg",
    tags: {},
});
import pulumi
import pulumi_azure_native as azure_native

alert_processing_rule_by_name = azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName",
    alert_processing_rule_name="AddActionGroupsBySeverity",
    location="Global",
    properties={
        "actions": [{
            "action_group_ids": [
                "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1",
                "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2",
            ],
            "action_type": "AddActionGroups",
        }],
        "conditions": [{
            "field": azure_native.alertsmanagement.Field.SEVERITY,
            "operator": azure_native.alertsmanagement.Operator.EQUALS,
            "values": [
                "sev0",
                "sev1",
            ],
        }],
        "description": "Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups",
        "enabled": True,
        "scopes": [
            "/subscriptions/subId1/resourceGroups/RGId1",
            "/subscriptions/subId1/resourceGroups/RGId2",
        ],
    },
    resource_group_name="alertscorrelationrg",
    tags={})
package main

import (
	alertsmanagement "github.com/pulumi/pulumi-azure-native-sdk/alertsmanagement/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := alertsmanagement.NewAlertProcessingRuleByName(ctx, "alertProcessingRuleByName", &alertsmanagement.AlertProcessingRuleByNameArgs{
			AlertProcessingRuleName: pulumi.String("AddActionGroupsBySeverity"),
			Location:                pulumi.String("Global"),
			Properties: &alertsmanagement.AlertProcessingRulePropertiesArgs{
				Actions: pulumi.Array{
					alertsmanagement.AddActionGroups{
						ActionGroupIds: []string{
							"/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1",
							"/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2",
						},
						ActionType: "AddActionGroups",
					},
				},
				Conditions: alertsmanagement.ConditionArray{
					&alertsmanagement.ConditionArgs{
						Field:    pulumi.String(alertsmanagement.FieldSeverity),
						Operator: pulumi.String(alertsmanagement.OperatorEquals),
						Values: pulumi.StringArray{
							pulumi.String("sev0"),
							pulumi.String("sev1"),
						},
					},
				},
				Description: pulumi.String("Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups"),
				Enabled:     pulumi.Bool(true),
				Scopes: pulumi.StringArray{
					pulumi.String("/subscriptions/subId1/resourceGroups/RGId1"),
					pulumi.String("/subscriptions/subId1/resourceGroups/RGId2"),
				},
			},
			ResourceGroupName: pulumi.String("alertscorrelationrg"),
			Tags:              pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var alertProcessingRuleByName = new AzureNative.AlertsManagement.AlertProcessingRuleByName("alertProcessingRuleByName", new()
    {
        AlertProcessingRuleName = "AddActionGroupsBySeverity",
        Location = "Global",
        Properties = new AzureNative.AlertsManagement.Inputs.AlertProcessingRulePropertiesArgs
        {
            Actions = new[]
            {
                new AzureNative.AlertsManagement.Inputs.AddActionGroupsArgs
                {
                    ActionGroupIds = new[]
                    {
                        "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1",
                        "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2",
                    },
                    ActionType = "AddActionGroups",
                },
            },
            Conditions = new[]
            {
                new AzureNative.AlertsManagement.Inputs.ConditionArgs
                {
                    Field = AzureNative.AlertsManagement.Field.Severity,
                    Operator = AzureNative.AlertsManagement.Operator.EqualsValue,
                    Values = new[]
                    {
                        "sev0",
                        "sev1",
                    },
                },
            },
            Description = "Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups",
            Enabled = true,
            Scopes = new[]
            {
                "/subscriptions/subId1/resourceGroups/RGId1",
                "/subscriptions/subId1/resourceGroups/RGId2",
            },
        },
        ResourceGroupName = "alertscorrelationrg",
        Tags = null,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByName;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByNameArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.AlertProcessingRulePropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertProcessingRuleByName = new AlertProcessingRuleByName("alertProcessingRuleByName", AlertProcessingRuleByNameArgs.builder()
            .alertProcessingRuleName("AddActionGroupsBySeverity")
            .location("Global")
            .properties(AlertProcessingRulePropertiesArgs.builder()
                .actions(AddActionGroupsArgs.builder()
                    .actionGroupIds(                    
                        "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1",
                        "/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2")
                    .actionType("AddActionGroups")
                    .build())
                .conditions(ConditionArgs.builder()
                    .field("Severity")
                    .operator("Equals")
                    .values(                    
                        "sev0",
                        "sev1")
                    .build())
                .description("Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups")
                .enabled(true)
                .scopes(                
                    "/subscriptions/subId1/resourceGroups/RGId1",
                    "/subscriptions/subId1/resourceGroups/RGId2")
                .build())
            .resourceGroupName("alertscorrelationrg")
            .tags(Map.ofEntries(
            ))
            .build());

    }
}
resources:
  alertProcessingRuleByName:
    type: azure-native:alertsmanagement:AlertProcessingRuleByName
    properties:
      alertProcessingRuleName: AddActionGroupsBySeverity
      location: Global
      properties:
        actions:
          - actionGroupIds:
              - /subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1
              - /subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2
            actionType: AddActionGroups
        conditions:
          - field: Severity
            operator: Equals
            values:
              - sev0
              - sev1
        description: Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups
        enabled: true
        scopes:
          - /subscriptions/subId1/resourceGroups/RGId1
          - /subscriptions/subId1/resourceGroups/RGId2
      resourceGroupName: alertscorrelationrg
      tags: {}

The conditions array filters which alerts trigger the rule. Here, the Severity field with Equals operator matches only sev0 and sev1 alerts. The rule applies to two resource groups and routes matching alerts to two action groups, ensuring critical incidents reach multiple notification channels.

Suppress notifications during one-time maintenance

Planned maintenance generates expected alerts that don’t require action. A one-time suppression window prevents notification fatigue.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertProcessingRuleByName = new azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName", {
    alertProcessingRuleName: "RemoveActionGroupsMaintenanceWindow",
    location: "Global",
    properties: {
        actions: [{
            actionType: "RemoveAllActionGroups",
        }],
        description: "Removes all ActionGroups from all Alerts on VMName during the maintenance window",
        enabled: true,
        schedule: {
            effectiveFrom: "2021-04-15T18:00:00",
            effectiveUntil: "2021-04-15T20:00:00",
            timeZone: "Pacific Standard Time",
        },
        scopes: ["/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName"],
    },
    resourceGroupName: "alertscorrelationrg",
    tags: {},
});
import pulumi
import pulumi_azure_native as azure_native

alert_processing_rule_by_name = azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName",
    alert_processing_rule_name="RemoveActionGroupsMaintenanceWindow",
    location="Global",
    properties={
        "actions": [{
            "action_type": "RemoveAllActionGroups",
        }],
        "description": "Removes all ActionGroups from all Alerts on VMName during the maintenance window",
        "enabled": True,
        "schedule": {
            "effective_from": "2021-04-15T18:00:00",
            "effective_until": "2021-04-15T20:00:00",
            "time_zone": "Pacific Standard Time",
        },
        "scopes": ["/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName"],
    },
    resource_group_name="alertscorrelationrg",
    tags={})
package main

import (
	alertsmanagement "github.com/pulumi/pulumi-azure-native-sdk/alertsmanagement/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := alertsmanagement.NewAlertProcessingRuleByName(ctx, "alertProcessingRuleByName", &alertsmanagement.AlertProcessingRuleByNameArgs{
			AlertProcessingRuleName: pulumi.String("RemoveActionGroupsMaintenanceWindow"),
			Location:                pulumi.String("Global"),
			Properties: &alertsmanagement.AlertProcessingRulePropertiesArgs{
				Actions: pulumi.Array{
					alertsmanagement.RemoveAllActionGroups{
						ActionType: "RemoveAllActionGroups",
					},
				},
				Description: pulumi.String("Removes all ActionGroups from all Alerts on VMName during the maintenance window"),
				Enabled:     pulumi.Bool(true),
				Schedule: &alertsmanagement.ScheduleArgs{
					EffectiveFrom:  pulumi.String("2021-04-15T18:00:00"),
					EffectiveUntil: pulumi.String("2021-04-15T20:00:00"),
					TimeZone:       pulumi.String("Pacific Standard Time"),
				},
				Scopes: pulumi.StringArray{
					pulumi.String("/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName"),
				},
			},
			ResourceGroupName: pulumi.String("alertscorrelationrg"),
			Tags:              pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var alertProcessingRuleByName = new AzureNative.AlertsManagement.AlertProcessingRuleByName("alertProcessingRuleByName", new()
    {
        AlertProcessingRuleName = "RemoveActionGroupsMaintenanceWindow",
        Location = "Global",
        Properties = new AzureNative.AlertsManagement.Inputs.AlertProcessingRulePropertiesArgs
        {
            Actions = new[]
            {
                new AzureNative.AlertsManagement.Inputs.RemoveAllActionGroupsArgs
                {
                    ActionType = "RemoveAllActionGroups",
                },
            },
            Description = "Removes all ActionGroups from all Alerts on VMName during the maintenance window",
            Enabled = true,
            Schedule = new AzureNative.AlertsManagement.Inputs.ScheduleArgs
            {
                EffectiveFrom = "2021-04-15T18:00:00",
                EffectiveUntil = "2021-04-15T20:00:00",
                TimeZone = "Pacific Standard Time",
            },
            Scopes = new[]
            {
                "/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName",
            },
        },
        ResourceGroupName = "alertscorrelationrg",
        Tags = null,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByName;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByNameArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.AlertProcessingRulePropertiesArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.ScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertProcessingRuleByName = new AlertProcessingRuleByName("alertProcessingRuleByName", AlertProcessingRuleByNameArgs.builder()
            .alertProcessingRuleName("RemoveActionGroupsMaintenanceWindow")
            .location("Global")
            .properties(AlertProcessingRulePropertiesArgs.builder()
                .actions(RemoveAllActionGroupsArgs.builder()
                    .actionType("RemoveAllActionGroups")
                    .build())
                .description("Removes all ActionGroups from all Alerts on VMName during the maintenance window")
                .enabled(true)
                .schedule(ScheduleArgs.builder()
                    .effectiveFrom("2021-04-15T18:00:00")
                    .effectiveUntil("2021-04-15T20:00:00")
                    .timeZone("Pacific Standard Time")
                    .build())
                .scopes("/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName")
                .build())
            .resourceGroupName("alertscorrelationrg")
            .tags(Map.ofEntries(
            ))
            .build());

    }
}
resources:
  alertProcessingRuleByName:
    type: azure-native:alertsmanagement:AlertProcessingRuleByName
    properties:
      alertProcessingRuleName: RemoveActionGroupsMaintenanceWindow
      location: Global
      properties:
        actions:
          - actionType: RemoveAllActionGroups
        description: Removes all ActionGroups from all Alerts on VMName during the maintenance window
        enabled: true
        schedule:
          effectiveFrom: 2021-04-15T18:00:00
          effectiveUntil: 2021-04-15T20:00:00
          timeZone: Pacific Standard Time
        scopes:
          - /subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName
      resourceGroupName: alertscorrelationrg
      tags: {}

The RemoveAllActionGroups action type strips all action groups from matching alerts, silencing notifications. The schedule property defines when suppression occurs: effectiveFrom and effectiveUntil set the maintenance window boundaries, and timeZone ensures the times are interpreted correctly. This rule targets a specific VM resource.

Suppress VM alerts on a recurring schedule

Regular maintenance windows require recurring suppression rules that combine resource type filtering with weekly schedules.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertProcessingRuleByName = new azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName", {
    alertProcessingRuleName: "RemoveActionGroupsRecurringMaintenance",
    location: "Global",
    properties: {
        actions: [{
            actionType: "RemoveAllActionGroups",
        }],
        conditions: [{
            field: azure_native.alertsmanagement.Field.TargetResourceType,
            operator: azure_native.alertsmanagement.Operator.Equals,
            values: ["microsoft.compute/virtualmachines"],
        }],
        description: "Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance",
        enabled: true,
        schedule: {
            recurrences: [{
                daysOfWeek: [
                    azure_native.alertsmanagement.DaysOfWeek.Saturday,
                    azure_native.alertsmanagement.DaysOfWeek.Sunday,
                ],
                endTime: "04:00:00",
                recurrenceType: "Weekly",
                startTime: "22:00:00",
            }],
            timeZone: "India Standard Time",
        },
        scopes: [
            "/subscriptions/subId1/resourceGroups/RGId1",
            "/subscriptions/subId1/resourceGroups/RGId2",
        ],
    },
    resourceGroupName: "alertscorrelationrg",
    tags: {},
});
import pulumi
import pulumi_azure_native as azure_native

alert_processing_rule_by_name = azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName",
    alert_processing_rule_name="RemoveActionGroupsRecurringMaintenance",
    location="Global",
    properties={
        "actions": [{
            "action_type": "RemoveAllActionGroups",
        }],
        "conditions": [{
            "field": azure_native.alertsmanagement.Field.TARGET_RESOURCE_TYPE,
            "operator": azure_native.alertsmanagement.Operator.EQUALS,
            "values": ["microsoft.compute/virtualmachines"],
        }],
        "description": "Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance",
        "enabled": True,
        "schedule": {
            "recurrences": [{
                "days_of_week": [
                    azure_native.alertsmanagement.DaysOfWeek.SATURDAY,
                    azure_native.alertsmanagement.DaysOfWeek.SUNDAY,
                ],
                "end_time": "04:00:00",
                "recurrence_type": "Weekly",
                "start_time": "22:00:00",
            }],
            "time_zone": "India Standard Time",
        },
        "scopes": [
            "/subscriptions/subId1/resourceGroups/RGId1",
            "/subscriptions/subId1/resourceGroups/RGId2",
        ],
    },
    resource_group_name="alertscorrelationrg",
    tags={})
package main

import (
	alertsmanagement "github.com/pulumi/pulumi-azure-native-sdk/alertsmanagement/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := alertsmanagement.NewAlertProcessingRuleByName(ctx, "alertProcessingRuleByName", &alertsmanagement.AlertProcessingRuleByNameArgs{
			AlertProcessingRuleName: pulumi.String("RemoveActionGroupsRecurringMaintenance"),
			Location:                pulumi.String("Global"),
			Properties: &alertsmanagement.AlertProcessingRulePropertiesArgs{
				Actions: pulumi.Array{
					alertsmanagement.RemoveAllActionGroups{
						ActionType: "RemoveAllActionGroups",
					},
				},
				Conditions: alertsmanagement.ConditionArray{
					&alertsmanagement.ConditionArgs{
						Field:    pulumi.String(alertsmanagement.FieldTargetResourceType),
						Operator: pulumi.String(alertsmanagement.OperatorEquals),
						Values: pulumi.StringArray{
							pulumi.String("microsoft.compute/virtualmachines"),
						},
					},
				},
				Description: pulumi.String("Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance"),
				Enabled:     pulumi.Bool(true),
				Schedule: &alertsmanagement.ScheduleArgs{
					Recurrences: pulumi.Array{
						alertsmanagement.WeeklyRecurrence{
							DaysOfWeek: []alertsmanagement.DaysOfWeek{
								alertsmanagement.DaysOfWeekSaturday,
								alertsmanagement.DaysOfWeekSunday,
							},
							EndTime:        "04:00:00",
							RecurrenceType: "Weekly",
							StartTime:      "22:00:00",
						},
					},
					TimeZone: pulumi.String("India Standard Time"),
				},
				Scopes: pulumi.StringArray{
					pulumi.String("/subscriptions/subId1/resourceGroups/RGId1"),
					pulumi.String("/subscriptions/subId1/resourceGroups/RGId2"),
				},
			},
			ResourceGroupName: pulumi.String("alertscorrelationrg"),
			Tags:              pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var alertProcessingRuleByName = new AzureNative.AlertsManagement.AlertProcessingRuleByName("alertProcessingRuleByName", new()
    {
        AlertProcessingRuleName = "RemoveActionGroupsRecurringMaintenance",
        Location = "Global",
        Properties = new AzureNative.AlertsManagement.Inputs.AlertProcessingRulePropertiesArgs
        {
            Actions = new[]
            {
                new AzureNative.AlertsManagement.Inputs.RemoveAllActionGroupsArgs
                {
                    ActionType = "RemoveAllActionGroups",
                },
            },
            Conditions = new[]
            {
                new AzureNative.AlertsManagement.Inputs.ConditionArgs
                {
                    Field = AzureNative.AlertsManagement.Field.TargetResourceType,
                    Operator = AzureNative.AlertsManagement.Operator.EqualsValue,
                    Values = new[]
                    {
                        "microsoft.compute/virtualmachines",
                    },
                },
            },
            Description = "Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance",
            Enabled = true,
            Schedule = new AzureNative.AlertsManagement.Inputs.ScheduleArgs
            {
                Recurrences = new[]
                {
                    new AzureNative.AlertsManagement.Inputs.WeeklyRecurrenceArgs
                    {
                        DaysOfWeek = new[]
                        {
                            AzureNative.AlertsManagement.DaysOfWeek.Saturday,
                            AzureNative.AlertsManagement.DaysOfWeek.Sunday,
                        },
                        EndTime = "04:00:00",
                        RecurrenceType = "Weekly",
                        StartTime = "22:00:00",
                    },
                },
                TimeZone = "India Standard Time",
            },
            Scopes = new[]
            {
                "/subscriptions/subId1/resourceGroups/RGId1",
                "/subscriptions/subId1/resourceGroups/RGId2",
            },
        },
        ResourceGroupName = "alertscorrelationrg",
        Tags = null,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByName;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByNameArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.AlertProcessingRulePropertiesArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.ScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertProcessingRuleByName = new AlertProcessingRuleByName("alertProcessingRuleByName", AlertProcessingRuleByNameArgs.builder()
            .alertProcessingRuleName("RemoveActionGroupsRecurringMaintenance")
            .location("Global")
            .properties(AlertProcessingRulePropertiesArgs.builder()
                .actions(RemoveAllActionGroupsArgs.builder()
                    .actionType("RemoveAllActionGroups")
                    .build())
                .conditions(ConditionArgs.builder()
                    .field("TargetResourceType")
                    .operator("Equals")
                    .values("microsoft.compute/virtualmachines")
                    .build())
                .description("Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance")
                .enabled(true)
                .schedule(ScheduleArgs.builder()
                    .recurrences(WeeklyRecurrenceArgs.builder()
                        .daysOfWeek(                        
                            "Saturday",
                            "Sunday")
                        .endTime("04:00:00")
                        .recurrenceType("Weekly")
                        .startTime("22:00:00")
                        .build())
                    .timeZone("India Standard Time")
                    .build())
                .scopes(                
                    "/subscriptions/subId1/resourceGroups/RGId1",
                    "/subscriptions/subId1/resourceGroups/RGId2")
                .build())
            .resourceGroupName("alertscorrelationrg")
            .tags(Map.ofEntries(
            ))
            .build());

    }
}
resources:
  alertProcessingRuleByName:
    type: azure-native:alertsmanagement:AlertProcessingRuleByName
    properties:
      alertProcessingRuleName: RemoveActionGroupsRecurringMaintenance
      location: Global
      properties:
        actions:
          - actionType: RemoveAllActionGroups
        conditions:
          - field: TargetResourceType
            operator: Equals
            values:
              - microsoft.compute/virtualmachines
        description: Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance
        enabled: true
        schedule:
          recurrences:
            - daysOfWeek:
                - Saturday
                - Sunday
              endTime: 04:00:00
              recurrenceType: Weekly
              startTime: 22:00:00
          timeZone: India Standard Time
        scopes:
          - /subscriptions/subId1/resourceGroups/RGId1
          - /subscriptions/subId1/resourceGroups/RGId2
      resourceGroupName: alertscorrelationrg
      tags: {}

The recurrences array defines repeating patterns. WeeklyRecurrence specifies daysOfWeek (Saturday and Sunday), startTime (22:00), and endTime (04:00). The conditions array filters by TargetResourceType, applying the rule only to virtual machine alerts. This prevents VM alerts during predictable weekend maintenance.

Suppress alerts outside business hours

Some teams only respond to alerts during business hours. Multiple recurrence patterns define when notifications should be suppressed.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertProcessingRuleByName = new azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName", {
    alertProcessingRuleName: "RemoveActionGroupsOutsideBusinessHours",
    location: "Global",
    properties: {
        actions: [{
            actionType: "RemoveAllActionGroups",
        }],
        description: "Remove all ActionGroups outside business hours",
        enabled: true,
        schedule: {
            recurrences: [
                {
                    endTime: "09:00:00",
                    recurrenceType: "Daily",
                    startTime: "17:00:00",
                },
                {
                    daysOfWeek: [
                        azure_native.alertsmanagement.DaysOfWeek.Saturday,
                        azure_native.alertsmanagement.DaysOfWeek.Sunday,
                    ],
                    recurrenceType: "Weekly",
                },
            ],
            timeZone: "Eastern Standard Time",
        },
        scopes: ["/subscriptions/subId1"],
    },
    resourceGroupName: "alertscorrelationrg",
    tags: {},
});
import pulumi
import pulumi_azure_native as azure_native

alert_processing_rule_by_name = azure_native.alertsmanagement.AlertProcessingRuleByName("alertProcessingRuleByName",
    alert_processing_rule_name="RemoveActionGroupsOutsideBusinessHours",
    location="Global",
    properties={
        "actions": [{
            "action_type": "RemoveAllActionGroups",
        }],
        "description": "Remove all ActionGroups outside business hours",
        "enabled": True,
        "schedule": {
            "recurrences": [
                {
                    "end_time": "09:00:00",
                    "recurrence_type": "Daily",
                    "start_time": "17:00:00",
                },
                {
                    "days_of_week": [
                        azure_native.alertsmanagement.DaysOfWeek.SATURDAY,
                        azure_native.alertsmanagement.DaysOfWeek.SUNDAY,
                    ],
                    "recurrence_type": "Weekly",
                },
            ],
            "time_zone": "Eastern Standard Time",
        },
        "scopes": ["/subscriptions/subId1"],
    },
    resource_group_name="alertscorrelationrg",
    tags={})
package main

import (
	alertsmanagement "github.com/pulumi/pulumi-azure-native-sdk/alertsmanagement/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := alertsmanagement.NewAlertProcessingRuleByName(ctx, "alertProcessingRuleByName", &alertsmanagement.AlertProcessingRuleByNameArgs{
			AlertProcessingRuleName: pulumi.String("RemoveActionGroupsOutsideBusinessHours"),
			Location:                pulumi.String("Global"),
			Properties: &alertsmanagement.AlertProcessingRulePropertiesArgs{
				Actions: pulumi.Array{
					alertsmanagement.RemoveAllActionGroups{
						ActionType: "RemoveAllActionGroups",
					},
				},
				Description: pulumi.String("Remove all ActionGroups outside business hours"),
				Enabled:     pulumi.Bool(true),
				Schedule: &alertsmanagement.ScheduleArgs{
					Recurrences: pulumi.Array{
						alertsmanagement.DailyRecurrence{
							EndTime:        "09:00:00",
							RecurrenceType: "Daily",
							StartTime:      "17:00:00",
						},
						alertsmanagement.WeeklyRecurrence{
							DaysOfWeek: []alertsmanagement.DaysOfWeek{
								alertsmanagement.DaysOfWeekSaturday,
								alertsmanagement.DaysOfWeekSunday,
							},
							RecurrenceType: "Weekly",
						},
					},
					TimeZone: pulumi.String("Eastern Standard Time"),
				},
				Scopes: pulumi.StringArray{
					pulumi.String("/subscriptions/subId1"),
				},
			},
			ResourceGroupName: pulumi.String("alertscorrelationrg"),
			Tags:              pulumi.StringMap{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var alertProcessingRuleByName = new AzureNative.AlertsManagement.AlertProcessingRuleByName("alertProcessingRuleByName", new()
    {
        AlertProcessingRuleName = "RemoveActionGroupsOutsideBusinessHours",
        Location = "Global",
        Properties = new AzureNative.AlertsManagement.Inputs.AlertProcessingRulePropertiesArgs
        {
            Actions = new[]
            {
                new AzureNative.AlertsManagement.Inputs.RemoveAllActionGroupsArgs
                {
                    ActionType = "RemoveAllActionGroups",
                },
            },
            Description = "Remove all ActionGroups outside business hours",
            Enabled = true,
            Schedule = new AzureNative.AlertsManagement.Inputs.ScheduleArgs
            {
                Recurrences = 
                {
                    new AzureNative.AlertsManagement.Inputs.DailyRecurrenceArgs
                    {
                        EndTime = "09:00:00",
                        RecurrenceType = "Daily",
                        StartTime = "17:00:00",
                    },
                    new AzureNative.AlertsManagement.Inputs.WeeklyRecurrenceArgs
                    {
                        DaysOfWeek = new[]
                        {
                            AzureNative.AlertsManagement.DaysOfWeek.Saturday,
                            AzureNative.AlertsManagement.DaysOfWeek.Sunday,
                        },
                        RecurrenceType = "Weekly",
                    },
                },
                TimeZone = "Eastern Standard Time",
            },
            Scopes = new[]
            {
                "/subscriptions/subId1",
            },
        },
        ResourceGroupName = "alertscorrelationrg",
        Tags = null,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByName;
import com.pulumi.azurenative.alertsmanagement.AlertProcessingRuleByNameArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.AlertProcessingRulePropertiesArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.ScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertProcessingRuleByName = new AlertProcessingRuleByName("alertProcessingRuleByName", AlertProcessingRuleByNameArgs.builder()
            .alertProcessingRuleName("RemoveActionGroupsOutsideBusinessHours")
            .location("Global")
            .properties(AlertProcessingRulePropertiesArgs.builder()
                .actions(RemoveAllActionGroupsArgs.builder()
                    .actionType("RemoveAllActionGroups")
                    .build())
                .description("Remove all ActionGroups outside business hours")
                .enabled(true)
                .schedule(ScheduleArgs.builder()
                    .recurrences(                    
                        DailyRecurrenceArgs.builder()
                            .endTime("09:00:00")
                            .recurrenceType("Daily")
                            .startTime("17:00:00")
                            .build(),
                        WeeklyRecurrenceArgs.builder()
                            .daysOfWeek(                            
                                "Saturday",
                                "Sunday")
                            .recurrenceType("Weekly")
                            .build())
                    .timeZone("Eastern Standard Time")
                    .build())
                .scopes("/subscriptions/subId1")
                .build())
            .resourceGroupName("alertscorrelationrg")
            .tags(Map.ofEntries(
            ))
            .build());

    }
}
resources:
  alertProcessingRuleByName:
    type: azure-native:alertsmanagement:AlertProcessingRuleByName
    properties:
      alertProcessingRuleName: RemoveActionGroupsOutsideBusinessHours
      location: Global
      properties:
        actions:
          - actionType: RemoveAllActionGroups
        description: Remove all ActionGroups outside business hours
        enabled: true
        schedule:
          recurrences:
            - endTime: 09:00:00
              recurrenceType: Daily
              startTime: 17:00:00
            - daysOfWeek:
                - Saturday
                - Sunday
              recurrenceType: Weekly
          timeZone: Eastern Standard Time
        scopes:
          - /subscriptions/subId1
      resourceGroupName: alertscorrelationrg
      tags: {}

This rule combines two recurrence patterns: DailyRecurrence covers off-hours (17:00 to 09:00), and WeeklyRecurrence covers weekends. The recurrenceType property distinguishes between pattern types. Together, they silence all alerts outside Monday-Friday 09:00-17:00 Eastern time.

Beyond these examples

These snippets focus on specific alert processing rule features: action group routing and suppression, severity and resource type filtering, and one-time and recurring maintenance windows. They’re intentionally minimal rather than full alerting solutions.

The examples may reference pre-existing infrastructure such as action groups for notifications, alert rules generating alerts, and Azure resources referenced in scopes. They focus on configuring the processing rule rather than provisioning the surrounding alerting infrastructure.

To keep things focused, common filtering patterns are omitted, including:

  • Alert context filtering (AlertContext, MonitorService, MonitorCondition)
  • Signal type filtering (SignalType)
  • Alert rule name filtering (AlertRuleName)
  • Monthly recurrence patterns

These omissions are intentional: the goal is to illustrate how each alert processing rule feature is wired, not provide drop-in alerting modules. See the AlertProcessingRuleByName resource reference for all available configuration options.

Let's configure Azure Alert Processing Rules

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Actions & Scoping
What types of actions can alert processing rules perform?
Two action types are available: AddActionGroups adds action groups to matching alerts, while RemoveAllActionGroups suppresses all notifications from matching alerts.
What scopes can I apply alert processing rules to?
Rules can target entire subscriptions, specific resource groups, or individual resources. Provide the full Azure resource path in the scopes array.
Can I apply a rule to multiple resource groups?
Yes, include multiple resource group paths in the scopes array to apply the rule across multiple resource groups.
How do I suppress alerts during maintenance windows?
Use the RemoveAllActionGroups action type combined with a schedule to define when notifications should be suppressed.
Filtering & Conditions
How do I filter rules to only affect high-severity alerts?
Add a condition with field: Severity, operator: Equals, and values like ["sev0", "sev1"] to target specific severity levels.
Can I target alerts from a specific alert rule?
Yes, use a condition with field: AlertRuleId, operator: Equals, and the full alert rule resource path in values.
How do I apply rules only to specific resource types?
Use a condition with field: TargetResourceType, operator: Equals, and values like ["microsoft.compute/virtualmachines"].
Scheduling & Timing
How do I create a one-time maintenance window?
Configure schedule with effectiveFrom and effectiveUntil timestamps, plus a timeZone to define a specific time window.
How do I set up recurring maintenance windows?
Use schedule.recurrences with recurrenceType: Weekly, specify daysOfWeek, and set startTime and endTime for the window.
Can I suppress alerts outside business hours?
Yes, combine multiple recurrences: a Daily recurrence for overnight hours and a Weekly recurrence for weekends.
Configuration & Lifecycle
Which properties can't be changed after creating a rule?
The location, alertProcessingRuleName, and resourceGroupName properties are immutable. To change them, delete and recreate the resource.
What location should I use for alert processing rules?
Set location to "Global" for alert processing rules, as shown in all examples.
How do I temporarily disable a rule without deleting it?
Set the enabled property to false to deactivate the rule while preserving its configuration.

Using a different cloud?

Explore monitoring guides for other cloud providers: