Share via


Microsoft.Workloads monitors/alerts

Bicep resource definition

The monitors/alerts 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.Workloads/monitors/alerts resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Workloads/monitors/alerts@2024-02-01-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    alertRuleProperties: {
      actionGroups: [
        'string'
      ]
      alertQueryParameters: [
        {
          name: 'string'
          value: 'string'
        }
      ]
      autoMitigate: 'string'
      dimension: 'string'
      evaluationFrequency: int
      failingPeriodsOperator: 'string'
      failingPeriodsToAlert: int
      muteActionsDuration: int
      severity: int
      status: 'string'
      threshold: int
      thresholdOperator: 'string'
      windowSize: int
    }
    providerNames: [
      'string'
    ]
    providerType: 'string'
    templateName: 'string'
  }
}

Property Values

Microsoft.Workloads/monitors/alerts

Name Description Value
name The resource name string

Constraints:
Min length = 1
Pattern = ^[a-zA-Z0-9-_]+$ (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: monitors
properties Alert Instance properties AlertProperties

AlertProperties

Name Description Value
alertRuleProperties Describes the properties of an alert. AlertRuleProperties
providerNames Name of provider instances associated with the alert. string[]
providerType The provider type for alert. For example, the value can be SapHana. string
templateName Name of the alert template from which it was created. string

AlertQueryParameter

Name Description Value
name The name of the alert query parameter. string
value The value of the alert query parameter. string

AlertRuleProperties

Name Description Value
actionGroups Action Group resource Ids to invoke when the alert fires string[]
alertQueryParameters The alert query parameters. AlertQueryParameter[]
autoMitigate The value that indicates whether the alert should be automatically resolved or not. The default is Disable. 'Disable'
'Enable'
dimension Evaluation of metric on a particular column. string
evaluationFrequency How often the scheduled query rule is evaluated. int
failingPeriodsOperator The operator for failing periods. 'Equal'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual'
failingPeriodsToAlert The number of failing periods to trigger an alert. int
muteActionsDuration Mute actions for the chosen period of time after the alert is fired. int
severity Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. int

Constraints:
Min value = 0
Max value = 4
status Indicates whether the alert is in an enabled state. 'Disabled'
'Enabled'
threshold The threshold of the alert. int
thresholdOperator The threshold operator of the alert. 'Equal'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual'
windowSize The period of time on which the Alert query will be executed. int

ARM template resource definition

The monitors/alerts 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.Workloads/monitors/alerts resource, add the following JSON to your template.

{
  "type": "Microsoft.Workloads/monitors/alerts",
  "apiVersion": "2024-02-01-preview",
  "name": "string",
  "properties": {
    "alertRuleProperties": {
      "actionGroups": [ "string" ],
      "alertQueryParameters": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "autoMitigate": "string",
      "dimension": "string",
      "evaluationFrequency": "int",
      "failingPeriodsOperator": "string",
      "failingPeriodsToAlert": "int",
      "muteActionsDuration": "int",
      "severity": "int",
      "status": "string",
      "threshold": "int",
      "thresholdOperator": "string",
      "windowSize": "int"
    },
    "providerNames": [ "string" ],
    "providerType": "string",
    "templateName": "string"
  }
}

Property Values

Microsoft.Workloads/monitors/alerts

Name Description Value
apiVersion The api version '2024-02-01-preview'
name The resource name string

Constraints:
Min length = 1
Pattern = ^[a-zA-Z0-9-_]+$ (required)
properties Alert Instance properties AlertProperties
type The resource type 'Microsoft.Workloads/monitors/alerts'

AlertProperties

Name Description Value
alertRuleProperties Describes the properties of an alert. AlertRuleProperties
providerNames Name of provider instances associated with the alert. string[]
providerType The provider type for alert. For example, the value can be SapHana. string
templateName Name of the alert template from which it was created. string

AlertQueryParameter

Name Description Value
name The name of the alert query parameter. string
value The value of the alert query parameter. string

AlertRuleProperties

Name Description Value
actionGroups Action Group resource Ids to invoke when the alert fires string[]
alertQueryParameters The alert query parameters. AlertQueryParameter[]
autoMitigate The value that indicates whether the alert should be automatically resolved or not. The default is Disable. 'Disable'
'Enable'
dimension Evaluation of metric on a particular column. string
evaluationFrequency How often the scheduled query rule is evaluated. int
failingPeriodsOperator The operator for failing periods. 'Equal'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual'
failingPeriodsToAlert The number of failing periods to trigger an alert. int
muteActionsDuration Mute actions for the chosen period of time after the alert is fired. int
severity Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. int

Constraints:
Min value = 0
Max value = 4
status Indicates whether the alert is in an enabled state. 'Disabled'
'Enabled'
threshold The threshold of the alert. int
thresholdOperator The threshold operator of the alert. 'Equal'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual'
windowSize The period of time on which the Alert query will be executed. int

Usage Examples

Terraform (AzAPI provider) resource definition

The monitors/alerts 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.Workloads/monitors/alerts resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Workloads/monitors/alerts@2024-02-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      alertRuleProperties = {
        actionGroups = [
          "string"
        ]
        alertQueryParameters = [
          {
            name = "string"
            value = "string"
          }
        ]
        autoMitigate = "string"
        dimension = "string"
        evaluationFrequency = int
        failingPeriodsOperator = "string"
        failingPeriodsToAlert = int
        muteActionsDuration = int
        severity = int
        status = "string"
        threshold = int
        thresholdOperator = "string"
        windowSize = int
      }
      providerNames = [
        "string"
      ]
      providerType = "string"
      templateName = "string"
    }
  }
}

Property Values

Microsoft.Workloads/monitors/alerts

Name Description Value
name The resource name string

Constraints:
Min length = 1
Pattern = ^[a-zA-Z0-9-_]+$ (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: monitors
properties Alert Instance properties AlertProperties
type The resource type "Microsoft.Workloads/monitors/alerts@2024-02-01-preview"

AlertProperties

Name Description Value
alertRuleProperties Describes the properties of an alert. AlertRuleProperties
providerNames Name of provider instances associated with the alert. string[]
providerType The provider type for alert. For example, the value can be SapHana. string
templateName Name of the alert template from which it was created. string

AlertQueryParameter

Name Description Value
name The name of the alert query parameter. string
value The value of the alert query parameter. string

AlertRuleProperties

Name Description Value
actionGroups Action Group resource Ids to invoke when the alert fires string[]
alertQueryParameters The alert query parameters. AlertQueryParameter[]
autoMitigate The value that indicates whether the alert should be automatically resolved or not. The default is Disable. 'Disable'
'Enable'
dimension Evaluation of metric on a particular column. string
evaluationFrequency How often the scheduled query rule is evaluated. int
failingPeriodsOperator The operator for failing periods. 'Equal'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual'
failingPeriodsToAlert The number of failing periods to trigger an alert. int
muteActionsDuration Mute actions for the chosen period of time after the alert is fired. int
severity Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. int

Constraints:
Min value = 0
Max value = 4
status Indicates whether the alert is in an enabled state. 'Disabled'
'Enabled'
threshold The threshold of the alert. int
thresholdOperator The threshold operator of the alert. 'Equal'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual'
windowSize The period of time on which the Alert query will be executed. int