microsoft.alertsManagement smartDetectorAlertRules 2021-04-01

Remarks

For guidance on deploying monitoring solutions, see Create monitoring resources by using Bicep.

Bicep resource definition

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

resource symbolicname 'microsoft.alertsManagement/smartDetectorAlertRules@2021-04-01' = {
  location: 'string'
  name: 'string'
  properties: {
    actionGroups: {
      customEmailSubject: 'string'
      customWebhookPayload: 'string'
      groupIds: [
        'string'
      ]
    }
    description: 'string'
    detector: {
      id: 'string'
      parameters: {
        {customized property}: any(...)
      }
    }
    frequency: 'string'
    scope: [
      'string'
    ]
    severity: 'string'
    state: 'string'
    throttling: {
      duration: 'string'
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

Property Values

ActionGroupsInformation

Name Description Value
customEmailSubject An optional custom email subject to use in email notifications. string
customWebhookPayload An optional custom web-hook payload to use in web-hook notifications. string
groupIds The Action Group resource IDs. string[] (required)

AlertRuleProperties

Name Description Value
actionGroups The alert rule actions. ActionGroupsInformation (required)
description The alert rule description. string
detector The alert rule's detector. Detector (required)
frequency The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector. string (required)
scope The alert rule resources scope. string[] (required)
severity The alert rule severity. 'Sev0'
'Sev1'
'Sev2'
'Sev3'
'Sev4' (required)
state The alert rule state. 'Disabled'
'Enabled' (required)
throttling The alert rule throttling information. ThrottlingInformation

AzureResourceTags

Name Description Value

Detector

Name Description Value
id The detector id. string (required)
parameters The detector's parameters.' DetectorParameters

DetectorParameters

Name Description Value

microsoft.alertsManagement/smartDetectorAlertRules

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

ThrottlingInformation

Name Description Value
duration The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes string

ARM template resource definition

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

{
  "type": "microsoft.alertsManagement/smartDetectorAlertRules",
  "apiVersion": "2021-04-01",
  "name": "string",
  "location": "string",
  "properties": {
    "actionGroups": {
      "customEmailSubject": "string",
      "customWebhookPayload": "string",
      "groupIds": [ "string" ]
    },
    "description": "string",
    "detector": {
      "id": "string",
      "parameters": {
        "{customized property}": {}
      }
    },
    "frequency": "string",
    "scope": [ "string" ],
    "severity": "string",
    "state": "string",
    "throttling": {
      "duration": "string"
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property Values

ActionGroupsInformation

Name Description Value
customEmailSubject An optional custom email subject to use in email notifications. string
customWebhookPayload An optional custom web-hook payload to use in web-hook notifications. string
groupIds The Action Group resource IDs. string[] (required)

AlertRuleProperties

Name Description Value
actionGroups The alert rule actions. ActionGroupsInformation (required)
description The alert rule description. string
detector The alert rule's detector. Detector (required)
frequency The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector. string (required)
scope The alert rule resources scope. string[] (required)
severity The alert rule severity. 'Sev0'
'Sev1'
'Sev2'
'Sev3'
'Sev4' (required)
state The alert rule state. 'Disabled'
'Enabled' (required)
throttling The alert rule throttling information. ThrottlingInformation

AzureResourceTags

Name Description Value

Detector

Name Description Value
id The detector id. string (required)
parameters The detector's parameters.' DetectorParameters

DetectorParameters

Name Description Value

microsoft.alertsManagement/smartDetectorAlertRules

Name Description Value
apiVersion The api version '2021-04-01'
location The resource location. string
name The resource name string (required)
properties The properties of the alert rule. AlertRuleProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'microsoft.alertsManagement/smartDetectorAlertRules'

ThrottlingInformation

Name Description Value
duration The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes string

Usage Examples

Terraform (AzAPI provider) resource definition

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

resource "azapi_resource" "symbolicname" {
  type = "microsoft.alertsManagement/smartDetectorAlertRules@2021-04-01"
  name = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      actionGroups = {
        customEmailSubject = "string"
        customWebhookPayload = "string"
        groupIds = [
          "string"
        ]
      }
      description = "string"
      detector = {
        id = "string"
        parameters = {
          {customized property} = ?
        }
      }
      frequency = "string"
      scope = [
        "string"
      ]
      severity = "string"
      state = "string"
      throttling = {
        duration = "string"
      }
    }
  })
}

Property Values

ActionGroupsInformation

Name Description Value
customEmailSubject An optional custom email subject to use in email notifications. string
customWebhookPayload An optional custom web-hook payload to use in web-hook notifications. string
groupIds The Action Group resource IDs. string[] (required)

AlertRuleProperties

Name Description Value
actionGroups The alert rule actions. ActionGroupsInformation (required)
description The alert rule description. string
detector The alert rule's detector. Detector (required)
frequency The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector. string (required)
scope The alert rule resources scope. string[] (required)
severity The alert rule severity. 'Sev0'
'Sev1'
'Sev2'
'Sev3'
'Sev4' (required)
state The alert rule state. 'Disabled'
'Enabled' (required)
throttling The alert rule throttling information. ThrottlingInformation

AzureResourceTags

Name Description Value

Detector

Name Description Value
id The detector id. string (required)
parameters The detector's parameters.' DetectorParameters

DetectorParameters

Name Description Value

microsoft.alertsManagement/smartDetectorAlertRules

Name Description Value
location The resource location. string
name The resource name string (required)
properties The properties of the alert rule. AlertRuleProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "microsoft.alertsManagement/smartDetectorAlertRules@2021-04-01"

ThrottlingInformation

Name Description Value
duration The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes string