Microsoft.AlertsManagement actionRules

Bicep resource definition

The actionRules resource type can be deployed to:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AlertsManagement/actionRules resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.AlertsManagement/actionRules@2021-08-08' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    actions: [
      {
        actionType: 'string'
        // For remaining properties, see Action objects
      }
    ]
    conditions: [
      {
        field: 'string'
        operator: 'string'
        values: [
          'string'
        ]
      }
    ]
    description: 'string'
    enabled: bool
    schedule: {
      effectiveFrom: 'string'
      effectiveUntil: 'string'
      recurrences: [
        {
          endTime: 'string'
          startTime: 'string'
          recurrenceType: 'string'
          // For remaining properties, see Recurrence objects
        }
      ]
      timeZone: 'string'
    }
    scopes: [
      'string'
    ]
  }
}

Action objects

Set the actionType property to specify the type of object.

For AddActionGroups, use:

  actionType: 'AddActionGroups'
  actionGroupIds: [
    'string'
  ]

For RemoveAllActionGroups, use:

  actionType: 'RemoveAllActionGroups'

Recurrence objects

Set the recurrenceType property to specify the type of object.

For Daily, use:

  recurrenceType: 'Daily'

For Monthly, use:

  recurrenceType: 'Monthly'
  daysOfMonth: [
    int
  ]

For Weekly, use:

  recurrenceType: 'Weekly'
  daysOfWeek: [
    'string'
  ]

Property values

actionRules

Name Description Value
name The resource name string (required)
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties Alert processing rule properties. AlertProcessingRuleProperties

AlertProcessingRuleProperties

Name Description Value
actions Actions to be applied. Action[] (required)
conditions Conditions on which alerts will be filtered. Condition[]
description Description of alert processing rule. string
enabled Indicates if the given alert processing rule is enabled or disabled. bool
schedule Scheduling for alert processing rule. Schedule
scopes Scopes on which alert processing rule will apply. string[] (required)

Action

Name Description Value
actionType Set the object type AddActionGroups
RemoveAllActionGroups (required)

AddActionGroups

Name Description Value
actionType Action that should be applied. 'AddActionGroups' (required)
actionGroupIds List of action group Ids to add to alert processing rule. string[] (required)

RemoveAllActionGroups

Name Description Value
actionType Action that should be applied. 'RemoveAllActionGroups' (required)

Condition

Name Description Value
field Field for a given condition. 'AlertContext'
'AlertRuleId'
'AlertRuleName'
'Description'
'MonitorCondition'
'MonitorService'
'Severity'
'SignalType'
'TargetResource'
'TargetResourceGroup'
'TargetResourceType'
operator Operator for a given condition. 'Contains'
'DoesNotContain'
'Equals'
'NotEquals'
values List of values to match for a given condition. string[]

Schedule

Name Description Value
effectiveFrom Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix. string
effectiveUntil Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix. string
recurrences List of recurrences. Recurrence[]
timeZone Scheduling time zone. string

Recurrence

Name Description Value
endTime End time for recurrence. string
startTime Start time for recurrence. string
recurrenceType Set the object type Daily
Monthly
Weekly (required)

DailyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. 'Daily' (required)

MonthlyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. 'Monthly' (required)
daysOfMonth Specifies the values for monthly recurrence pattern. int[] (required)

WeeklyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. 'Weekly' (required)
daysOfWeek Specifies the values for weekly recurrence pattern. String array containing any of:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday' (required)

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Setup notifications for backup alerts using Azure Monitor

Deploy to Azure
This template enables you to setup email notifications for your Recovery Services vaults using Azure Monitor, by deploying an alert processing rule and an action group

ARM template resource definition

The actionRules resource type can be deployed to:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AlertsManagement/actionRules resource, add the following JSON to your template.

{
  "type": "Microsoft.AlertsManagement/actionRules",
  "apiVersion": "2021-08-08",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "actions": [
      {
        "actionType": "string"
        // For remaining properties, see Action objects
      }
    ],
    "conditions": [
      {
        "field": "string",
        "operator": "string",
        "values": [ "string" ]
      }
    ],
    "description": "string",
    "enabled": "bool",
    "schedule": {
      "effectiveFrom": "string",
      "effectiveUntil": "string",
      "recurrences": [
        {
          "endTime": "string",
          "startTime": "string",
          "recurrenceType": "string"
          // For remaining properties, see Recurrence objects
        }
      ],
      "timeZone": "string"
    },
    "scopes": [ "string" ]
  }
}

Action objects

Set the actionType property to specify the type of object.

For AddActionGroups, use:

  "actionType": "AddActionGroups",
  "actionGroupIds": [ "string" ]

For RemoveAllActionGroups, use:

  "actionType": "RemoveAllActionGroups"

Recurrence objects

Set the recurrenceType property to specify the type of object.

For Daily, use:

  "recurrenceType": "Daily"

For Monthly, use:

  "recurrenceType": "Monthly",
  "daysOfMonth": [ "int" ]

For Weekly, use:

  "recurrenceType": "Weekly",
  "daysOfWeek": [ "string" ]

Property values

actionRules

Name Description Value
type The resource type 'Microsoft.AlertsManagement/actionRules'
apiVersion The resource api version '2021-08-08'
name The resource name string (required)
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties Alert processing rule properties. AlertProcessingRuleProperties

AlertProcessingRuleProperties

Name Description Value
actions Actions to be applied. Action[] (required)
conditions Conditions on which alerts will be filtered. Condition[]
description Description of alert processing rule. string
enabled Indicates if the given alert processing rule is enabled or disabled. bool
schedule Scheduling for alert processing rule. Schedule
scopes Scopes on which alert processing rule will apply. string[] (required)

Action

Name Description Value
actionType Set the object type AddActionGroups
RemoveAllActionGroups (required)

AddActionGroups

Name Description Value
actionType Action that should be applied. 'AddActionGroups' (required)
actionGroupIds List of action group Ids to add to alert processing rule. string[] (required)

RemoveAllActionGroups

Name Description Value
actionType Action that should be applied. 'RemoveAllActionGroups' (required)

Condition

Name Description Value
field Field for a given condition. 'AlertContext'
'AlertRuleId'
'AlertRuleName'
'Description'
'MonitorCondition'
'MonitorService'
'Severity'
'SignalType'
'TargetResource'
'TargetResourceGroup'
'TargetResourceType'
operator Operator for a given condition. 'Contains'
'DoesNotContain'
'Equals'
'NotEquals'
values List of values to match for a given condition. string[]

Schedule

Name Description Value
effectiveFrom Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix. string
effectiveUntil Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix. string
recurrences List of recurrences. Recurrence[]
timeZone Scheduling time zone. string

Recurrence

Name Description Value
endTime End time for recurrence. string
startTime Start time for recurrence. string
recurrenceType Set the object type Daily
Monthly
Weekly (required)

DailyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. 'Daily' (required)

MonthlyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. 'Monthly' (required)
daysOfMonth Specifies the values for monthly recurrence pattern. int[] (required)

WeeklyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. 'Weekly' (required)
daysOfWeek Specifies the values for weekly recurrence pattern. String array containing any of:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday' (required)

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Setup notifications for backup alerts using Azure Monitor

Deploy to Azure
This template enables you to setup email notifications for your Recovery Services vaults using Azure Monitor, by deploying an alert processing rule and an action group

Terraform (AzAPI provider) resource definition

The actionRules resource type can be deployed to:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AlertsManagement/actionRules resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.AlertsManagement/actionRules@2021-08-08"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      actions = [
        {
          actionType = "string"
          // For remaining properties, see Action objects
        }
      ]
      conditions = [
        {
          field = "string"
          operator = "string"
          values = [
            "string"
          ]
        }
      ]
      description = "string"
      enabled = bool
      schedule = {
        effectiveFrom = "string"
        effectiveUntil = "string"
        recurrences = [
          {
            endTime = "string"
            startTime = "string"
            recurrenceType = "string"
            // For remaining properties, see Recurrence objects
          }
        ]
        timeZone = "string"
      }
      scopes = [
        "string"
      ]
    }
  })
}

Action objects

Set the actionType property to specify the type of object.

For AddActionGroups, use:

  actionType = "AddActionGroups"
  actionGroupIds = [
    "string"
  ]

For RemoveAllActionGroups, use:

  actionType = "RemoveAllActionGroups"

Recurrence objects

Set the recurrenceType property to specify the type of object.

For Daily, use:

  recurrenceType = "Daily"

For Monthly, use:

  recurrenceType = "Monthly"
  daysOfMonth = [
    int
  ]

For Weekly, use:

  recurrenceType = "Weekly"
  daysOfWeek = [
    "string"
  ]

Property values

actionRules

Name Description Value
type The resource type "Microsoft.AlertsManagement/actionRules@2021-08-08"
name The resource name string (required)
location Resource location string (required)
parent_id To deploy to a resource group, use the ID of that resource group. string (required)
tags Resource tags Dictionary of tag names and values.
properties Alert processing rule properties. AlertProcessingRuleProperties

AlertProcessingRuleProperties

Name Description Value
actions Actions to be applied. Action[] (required)
conditions Conditions on which alerts will be filtered. Condition[]
description Description of alert processing rule. string
enabled Indicates if the given alert processing rule is enabled or disabled. bool
schedule Scheduling for alert processing rule. Schedule
scopes Scopes on which alert processing rule will apply. string[] (required)

Action

Name Description Value
actionType Set the object type AddActionGroups
RemoveAllActionGroups (required)

AddActionGroups

Name Description Value
actionType Action that should be applied. "AddActionGroups" (required)
actionGroupIds List of action group Ids to add to alert processing rule. string[] (required)

RemoveAllActionGroups

Name Description Value
actionType Action that should be applied. "RemoveAllActionGroups" (required)

Condition

Name Description Value
field Field for a given condition. "AlertContext"
"AlertRuleId"
"AlertRuleName"
"Description"
"MonitorCondition"
"MonitorService"
"Severity"
"SignalType"
"TargetResource"
"TargetResourceGroup"
"TargetResourceType"
operator Operator for a given condition. "Contains"
"DoesNotContain"
"Equals"
"NotEquals"
values List of values to match for a given condition. string[]

Schedule

Name Description Value
effectiveFrom Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix. string
effectiveUntil Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix. string
recurrences List of recurrences. Recurrence[]
timeZone Scheduling time zone. string

Recurrence

Name Description Value
endTime End time for recurrence. string
startTime Start time for recurrence. string
recurrenceType Set the object type Daily
Monthly
Weekly (required)

DailyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. "Daily" (required)

MonthlyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. "Monthly" (required)
daysOfMonth Specifies the values for monthly recurrence pattern. int[] (required)

WeeklyRecurrence

Name Description Value
recurrenceType Specifies when the recurrence should be applied. "Weekly" (required)
daysOfWeek Specifies the values for weekly recurrence pattern. String array containing any of:
"Friday"
"Monday"
"Saturday"
"Sunday"
"Thursday"
"Tuesday"
"Wednesday" (required)