Share via


Microsoft.AlertsManagement actionRules 2021-08-08-preview

Bicep resource definition

The actionRules resource type can be deployed with operations that target:

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-preview' = {
  location: 'string'
  name: 'string'
  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'
    ]
  }
  tags: {
    {customized property}: 'string'
  }
}

Recurrence objects

Set the recurrenceType property to specify the type of object.

For Daily, use:

{
  recurrenceType: 'Daily'
}

For Monthly, use:

{
  daysOfMonth: [
    int
  ]
  recurrenceType: 'Monthly'
}

For Weekly, use:

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

Action objects

Set the actionType property to specify the type of object.

For AddActionGroups, use:

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

For RemoveAllActionGroups, use:

{
  actionType: 'RemoveAllActionGroups'
}

Property Values

Microsoft.AlertsManagement/actionRules

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

Action

Name Description Value
actionType Set to 'AddActionGroups' for type AddActionGroups. Set to 'RemoveAllActionGroups' for type RemoveAllActionGroups. 'AddActionGroups'
'RemoveAllActionGroups' (required)

AddActionGroups

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

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)

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[]

DailyRecurrence

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

ManagedResourceTags

Name Description Value

MonthlyRecurrence

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

Recurrence

Name Description Value
endTime End time for recurrence. string
recurrenceType Set to 'Daily' for type DailyRecurrence. Set to 'Monthly' for type MonthlyRecurrence. Set to 'Weekly' for type WeeklyRecurrence. 'Daily'
'Monthly'
'Weekly' (required)
startTime Start time for recurrence. string

RemoveAllActionGroups

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

Schedule

Name Description Value
effectiveFrom Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix. string

Constraints:
Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$
effectiveUntil Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix. string

Constraints:
Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$
recurrences List of recurrences. Recurrence[]
timeZone Scheduling time zone. string

WeeklyRecurrence

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

Usage Examples

Azure Verified Modules

The following Azure Verified Modules can be used to deploy this resource type.

Module Description
Action Rules AVM Resource Module for Action Rules

Azure Quickstart Samples

The following Azure Quickstart templates contain Bicep samples for deploying this resource type.

Bicep File Description
Setup notifications for backup alerts using Azure Monitor 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 with operations that target:

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-preview",
  "name": "string",
  "location": "string",
  "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" ]
  },
  "tags": {
    "{customized property}": "string"
  }
}

Recurrence objects

Set the recurrenceType property to specify the type of object.

For Daily, use:

{
  "recurrenceType": "Daily"
}

For Monthly, use:

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

For Weekly, use:

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

Action objects

Set the actionType property to specify the type of object.

For AddActionGroups, use:

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

For RemoveAllActionGroups, use:

{
  "actionType": "RemoveAllActionGroups"
}

Property Values

Microsoft.AlertsManagement/actionRules

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

Action

Name Description Value
actionType Set to 'AddActionGroups' for type AddActionGroups. Set to 'RemoveAllActionGroups' for type RemoveAllActionGroups. 'AddActionGroups'
'RemoveAllActionGroups' (required)

AddActionGroups

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

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)

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[]

DailyRecurrence

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

ManagedResourceTags

Name Description Value

MonthlyRecurrence

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

Recurrence

Name Description Value
endTime End time for recurrence. string
recurrenceType Set to 'Daily' for type DailyRecurrence. Set to 'Monthly' for type MonthlyRecurrence. Set to 'Weekly' for type WeeklyRecurrence. 'Daily'
'Monthly'
'Weekly' (required)
startTime Start time for recurrence. string

RemoveAllActionGroups

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

Schedule

Name Description Value
effectiveFrom Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix. string

Constraints:
Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$
effectiveUntil Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix. string

Constraints:
Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$
recurrences List of recurrences. Recurrence[]
timeZone Scheduling time zone. string

WeeklyRecurrence

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

Usage Examples

Azure Quickstart Templates

The following Azure 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 with operations that target:

  • 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-preview"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    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"
      ]
    }
  }
}

Recurrence objects

Set the recurrenceType property to specify the type of object.

For Daily, use:

{
  recurrenceType = "Daily"
}

For Monthly, use:

{
  daysOfMonth = [
    int
  ]
  recurrenceType = "Monthly"
}

For Weekly, use:

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

Action objects

Set the actionType property to specify the type of object.

For AddActionGroups, use:

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

For RemoveAllActionGroups, use:

{
  actionType = "RemoveAllActionGroups"
}

Property Values

Microsoft.AlertsManagement/actionRules

Name Description Value
location Resource location string (required)
name The resource name string (required)
properties Alert processing rule properties. AlertProcessingRuleProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.AlertsManagement/actionRules@2021-08-08-preview"

Action

Name Description Value
actionType Set to 'AddActionGroups' for type AddActionGroups. Set to 'RemoveAllActionGroups' for type RemoveAllActionGroups. 'AddActionGroups'
'RemoveAllActionGroups' (required)

AddActionGroups

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

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)

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[]

DailyRecurrence

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

ManagedResourceTags

Name Description Value

MonthlyRecurrence

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

Recurrence

Name Description Value
endTime End time for recurrence. string
recurrenceType Set to 'Daily' for type DailyRecurrence. Set to 'Monthly' for type MonthlyRecurrence. Set to 'Weekly' for type WeeklyRecurrence. 'Daily'
'Monthly'
'Weekly' (required)
startTime Start time for recurrence. string

RemoveAllActionGroups

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

Schedule

Name Description Value
effectiveFrom Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix. string

Constraints:
Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$
effectiveUntil Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix. string

Constraints:
Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$
recurrences List of recurrences. Recurrence[]
timeZone Scheduling time zone. string

WeeklyRecurrence

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