Microsoft.Insights metricAlerts

Bicep resource definition

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

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

Remarks

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

Resource format

To create a Microsoft.Insights/metricAlerts resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Insights/metricAlerts@2018-03-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    actions: [
      {
        actionGroupId: 'string'
        webHookProperties: {
          {customized property}: 'string'
        }
      }
    ]
    autoMitigate: bool
    criteria: {
      'odata.type': 'string'
      // For remaining properties, see MetricAlertCriteria objects
    }
    description: 'string'
    enabled: bool
    evaluationFrequency: 'string'
    scopes: [
      'string'
    ]
    severity: int
    targetResourceRegion: 'string'
    targetResourceType: 'string'
    windowSize: 'string'
  }
}

MetricAlertCriteria objects

Set the odata.type property to specify the type of object.

For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:

  'odata.type': 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
  allOf: [
    {
      dimensions: [
        {
          name: 'string'
          operator: 'string'
          values: [
            'string'
          ]
        }
      ]
      metricName: 'string'
      metricNamespace: 'string'
      name: 'string'
      skipMetricValidation: bool
      timeAggregation: 'string'
      criterionType: 'string'
      // For remaining properties, see MultiMetricCriteria objects
    }
  ]

For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:

  'odata.type': 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
  allOf: [
    {
      criterionType: 'string'
      dimensions: [
        {
          name: 'string'
          operator: 'string'
          values: [
            'string'
          ]
        }
      ]
      metricName: 'string'
      metricNamespace: 'string'
      name: 'string'
      operator: 'string'
      skipMetricValidation: bool
      threshold: int
      timeAggregation: 'string'
      {customized property}: any()
    }
  ]

For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:

  'odata.type': 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria'
  componentId: 'string'
  failedLocationCount: int
  webTestId: 'string'

MultiMetricCriteria objects

Set the criterionType property to specify the type of object.

For DynamicThresholdCriterion, use:

  criterionType: 'DynamicThresholdCriterion'
  alertSensitivity: 'string'
  failingPeriods: {
    minFailingPeriodsToAlert: int
    numberOfEvaluationPeriods: int
  }
  ignoreDataBefore: 'string'
  operator: 'string'

For StaticThresholdCriterion, use:

  criterionType: 'StaticThresholdCriterion'
  operator: 'string'
  threshold: int

Property values

metricAlerts

Name Description Value
name The resource name string (required)

Character limit: 1-260

Valid characters:
Can't use:
*#&+:<>?@%{}\/| or control characters

Can't end with space or period.
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties The alert rule properties of the resource. MetricAlertProperties (required)

MetricAlertProperties

Name Description Value
actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. MetricAlertAction[]
autoMitigate the flag that indicates whether the alert should be auto resolved or not. The default is true. bool
criteria defines the specific alert criteria information. MetricAlertCriteria (required)
description the description of the metric alert that will be included in the alert email. string
enabled the flag that indicates whether the metric alert is enabled. bool (required)
evaluationFrequency how often the metric alert is evaluated represented in ISO 8601 duration format. string (required)
scopes the list of resource id's that this metric alert is scoped to. string[] (required)
severity Alert severity {0, 1, 2, 3, 4} int (required)
targetResourceRegion the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. string
targetResourceType the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. string
windowSize the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. string (required)

MetricAlertAction

Name Description Value
actionGroupId the id of the action group to use. string
webHookProperties This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. MetricAlertActionWebHookProperties

MetricAlertActionWebHookProperties

Name Description Value
{customized property} string

MetricAlertCriteria

Name Description Value
odata.type Set the object type Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria (required)

MetricAlertMultipleResourceMultipleMetricCriteria

Name Description Value
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (required)
allOf the list of multiple metric criteria for this 'all of' operation. MultiMetricCriteria[]

MultiMetricCriteria

Name Description Value
dimensions List of dimension conditions. MetricDimension[]
metricName Name of the metric. string (required)
metricNamespace Namespace of the metric. string
name Name of the criteria. string (required)
skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. bool
timeAggregation the criteria time aggregation types. 'Average'
'Count'
'Maximum'
'Minimum'
'Total' (required)
criterionType Set the object type DynamicThresholdCriterion
StaticThresholdCriterion (required)

MetricDimension

Name Description Value
name Name of the dimension. string (required)
operator the dimension operator. Only 'Include' and 'Exclude' are supported string (required)
values list of dimension values. string[] (required)

DynamicMetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria 'DynamicThresholdCriterion' (required)
alertSensitivity The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. 'High'
'Low'
'Medium' (required)
failingPeriods The minimum number of violations required within the selected lookback time window required to raise an alert. DynamicThresholdFailingPeriods (required)
ignoreDataBefore Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) string
operator The operator used to compare the metric value against the threshold. 'GreaterOrLessThan'
'GreaterThan'
'LessThan' (required)

DynamicThresholdFailingPeriods

Name Description Value
minFailingPeriodsToAlert The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. int (required)
numberOfEvaluationPeriods The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. int (required)

MetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria 'DynamicThresholdCriterion'
'StaticThresholdCriterion' (required)
dimensions List of dimension conditions. MetricDimension[]
metricName Name of the metric. string (required)
metricNamespace Namespace of the metric. string
name Name of the criteria. string (required)
operator the criteria operator. 'Equals'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual' (required)
skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. bool
threshold the criteria threshold value that activates the alert. int (required)
timeAggregation the criteria time aggregation types. 'Average'
'Count'
'Maximum'
'Minimum'
'Total' (required)
{customized property} For Bicep, you can use the any() function.

MetricAlertSingleResourceMultipleMetricCriteria

Name Description Value
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (required)
allOf The list of metric criteria for this 'all of' operation. MetricCriteria[]

WebtestLocationAvailabilityCriteria

Name Description Value
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required)
componentId The Application Insights resource Id. string (required)
failedLocationCount The number of failed locations. int (required)
webTestId The Application Insights web test Id. string (required)

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
BrowserBox Azure Edition

Deploy to Azure
This template deploys BrowserBox on an Azure Ubuntu Server 22.04 LTS, Debian 11, or RHEL 8.7 LVM VM.
Scalable Umbraco CMS Web App

Deploy to Azure
This template provides a easy way to deploy umbraco CMS web app on Azure App Service Web Apps.
Create alerts for your Application Gateway

Deploy to Azure
Use these templates to easily create some important event alerts for your Azure Application Gateway.
Alert for Backend Last Byte Response metric

Deploy to Azure
Use such templates to easily create some important event alerts for your Azure Application Gateway.
Alert for Unhealthy Host Count metric

Deploy to Azure
Use such templates to easily create some important event alerts for your Azure Application Gateway.
Enterprise Governance-AppService, SQL DB, AD, OMS, Runbooks

Deploy to Azure
Cloud adoption for an Enterprise, small or large, require responsible and efficient governance models to derive value from their cloud deployments. CloudWise (a code-name for the solution), is a composite solution available from Azure Partner QuickStarts, is an adoption enabler for Customers, System Integrators and Partners alike, that delivers a self-serviceable, automated governance and operations solution, focused on Optimizing Your Costs, Improve Your Application(s) Reliability, Reducing Business Risk. The solution highlights the core governance pillars of Visibility and Control.
Dynamic Web Test Creation

Deploy to Azure
Create any number of App Insights web (ping) tests.
Deploy Application Insight and create alert in it

Deploy to Azure
This template allows you to deploy Application Insight and create alert in it
Metric alert rule with a dynamic threshold

Deploy to Azure
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a dynamic threshold condition type.
Metric alert rule with a static threshold

Deploy to Azure
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a static threshold condition type.
Metric alert rule for an availability test

Deploy to Azure
This template creates an Application Insights availability test along with a metric alert rule that monitors it.

ARM template resource definition

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

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

Remarks

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

Resource format

To create a Microsoft.Insights/metricAlerts resource, add the following JSON to your template.

{
  "type": "Microsoft.Insights/metricAlerts",
  "apiVersion": "2018-03-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "actions": [
      {
        "actionGroupId": "string",
        "webHookProperties": {
          "{customized property}": "string"
        }
      }
    ],
    "autoMitigate": "bool",
    "criteria": {
      "odata.type": "string"
      // For remaining properties, see MetricAlertCriteria objects
    },
    "description": "string",
    "enabled": "bool",
    "evaluationFrequency": "string",
    "scopes": [ "string" ],
    "severity": "int",
    "targetResourceRegion": "string",
    "targetResourceType": "string",
    "windowSize": "string"
  }
}

MetricAlertCriteria objects

Set the odata.type property to specify the type of object.

For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:

  "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
  "allOf": [
    {
      "dimensions": [
        {
          "name": "string",
          "operator": "string",
          "values": [ "string" ]
        }
      ],
      "metricName": "string",
      "metricNamespace": "string",
      "name": "string",
      "skipMetricValidation": "bool",
      "timeAggregation": "string",
      "criterionType": "string"
      // For remaining properties, see MultiMetricCriteria objects
    }
  ]

For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:

  "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
  "allOf": [
    {
      "criterionType": "string",
      "dimensions": [
        {
          "name": "string",
          "operator": "string",
          "values": [ "string" ]
        }
      ],
      "metricName": "string",
      "metricNamespace": "string",
      "name": "string",
      "operator": "string",
      "skipMetricValidation": "bool",
      "threshold": "int",
      "timeAggregation": "string",
      "{customized property}": {}
    }
  ]

For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:

  "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
  "componentId": "string",
  "failedLocationCount": "int",
  "webTestId": "string"

MultiMetricCriteria objects

Set the criterionType property to specify the type of object.

For DynamicThresholdCriterion, use:

  "criterionType": "DynamicThresholdCriterion",
  "alertSensitivity": "string",
  "failingPeriods": {
    "minFailingPeriodsToAlert": "int",
    "numberOfEvaluationPeriods": "int"
  },
  "ignoreDataBefore": "string",
  "operator": "string"

For StaticThresholdCriterion, use:

  "criterionType": "StaticThresholdCriterion",
  "operator": "string",
  "threshold": "int"

Property values

metricAlerts

Name Description Value
type The resource type 'Microsoft.Insights/metricAlerts'
apiVersion The resource api version '2018-03-01'
name The resource name string (required)

Character limit: 1-260

Valid characters:
Can't use:
*#&+:<>?@%{}\/| or control characters

Can't end with space or period.
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties The alert rule properties of the resource. MetricAlertProperties (required)

MetricAlertProperties

Name Description Value
actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. MetricAlertAction[]
autoMitigate the flag that indicates whether the alert should be auto resolved or not. The default is true. bool
criteria defines the specific alert criteria information. MetricAlertCriteria (required)
description the description of the metric alert that will be included in the alert email. string
enabled the flag that indicates whether the metric alert is enabled. bool (required)
evaluationFrequency how often the metric alert is evaluated represented in ISO 8601 duration format. string (required)
scopes the list of resource id's that this metric alert is scoped to. string[] (required)
severity Alert severity {0, 1, 2, 3, 4} int (required)
targetResourceRegion the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. string
targetResourceType the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. string
windowSize the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. string (required)

MetricAlertAction

Name Description Value
actionGroupId the id of the action group to use. string
webHookProperties This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. MetricAlertActionWebHookProperties

MetricAlertActionWebHookProperties

Name Description Value
{customized property} string

MetricAlertCriteria

Name Description Value
odata.type Set the object type Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria (required)

MetricAlertMultipleResourceMultipleMetricCriteria

Name Description Value
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (required)
allOf the list of multiple metric criteria for this 'all of' operation. MultiMetricCriteria[]

MultiMetricCriteria

Name Description Value
dimensions List of dimension conditions. MetricDimension[]
metricName Name of the metric. string (required)
metricNamespace Namespace of the metric. string
name Name of the criteria. string (required)
skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. bool
timeAggregation the criteria time aggregation types. 'Average'
'Count'
'Maximum'
'Minimum'
'Total' (required)
criterionType Set the object type DynamicThresholdCriterion
StaticThresholdCriterion (required)

MetricDimension

Name Description Value
name Name of the dimension. string (required)
operator the dimension operator. Only 'Include' and 'Exclude' are supported string (required)
values list of dimension values. string[] (required)

DynamicMetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria 'DynamicThresholdCriterion' (required)
alertSensitivity The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. 'High'
'Low'
'Medium' (required)
failingPeriods The minimum number of violations required within the selected lookback time window required to raise an alert. DynamicThresholdFailingPeriods (required)
ignoreDataBefore Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) string
operator The operator used to compare the metric value against the threshold. 'GreaterOrLessThan'
'GreaterThan'
'LessThan' (required)

DynamicThresholdFailingPeriods

Name Description Value
minFailingPeriodsToAlert The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. int (required)
numberOfEvaluationPeriods The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. int (required)

MetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria 'DynamicThresholdCriterion'
'StaticThresholdCriterion' (required)
dimensions List of dimension conditions. MetricDimension[]
metricName Name of the metric. string (required)
metricNamespace Namespace of the metric. string
name Name of the criteria. string (required)
operator the criteria operator. 'Equals'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual' (required)
skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. bool
threshold the criteria threshold value that activates the alert. int (required)
timeAggregation the criteria time aggregation types. 'Average'
'Count'
'Maximum'
'Minimum'
'Total' (required)
{customized property}

MetricAlertSingleResourceMultipleMetricCriteria

Name Description Value
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (required)
allOf The list of metric criteria for this 'all of' operation. MetricCriteria[]

WebtestLocationAvailabilityCriteria

Name Description Value
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required)
componentId The Application Insights resource Id. string (required)
failedLocationCount The number of failed locations. int (required)
webTestId The Application Insights web test Id. string (required)

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
BrowserBox Azure Edition

Deploy to Azure
This template deploys BrowserBox on an Azure Ubuntu Server 22.04 LTS, Debian 11, or RHEL 8.7 LVM VM.
Scalable Umbraco CMS Web App

Deploy to Azure
This template provides a easy way to deploy umbraco CMS web app on Azure App Service Web Apps.
Create alerts for your Application Gateway

Deploy to Azure
Use these templates to easily create some important event alerts for your Azure Application Gateway.
Alert for Backend Last Byte Response metric

Deploy to Azure
Use such templates to easily create some important event alerts for your Azure Application Gateway.
Alert for Unhealthy Host Count metric

Deploy to Azure
Use such templates to easily create some important event alerts for your Azure Application Gateway.
Enterprise Governance-AppService, SQL DB, AD, OMS, Runbooks

Deploy to Azure
Cloud adoption for an Enterprise, small or large, require responsible and efficient governance models to derive value from their cloud deployments. CloudWise (a code-name for the solution), is a composite solution available from Azure Partner QuickStarts, is an adoption enabler for Customers, System Integrators and Partners alike, that delivers a self-serviceable, automated governance and operations solution, focused on Optimizing Your Costs, Improve Your Application(s) Reliability, Reducing Business Risk. The solution highlights the core governance pillars of Visibility and Control.
Dynamic Web Test Creation

Deploy to Azure
Create any number of App Insights web (ping) tests.
Deploy Application Insight and create alert in it

Deploy to Azure
This template allows you to deploy Application Insight and create alert in it
Metric alert rule with a dynamic threshold

Deploy to Azure
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a dynamic threshold condition type.
Metric alert rule with a static threshold

Deploy to Azure
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a static threshold condition type.
Metric alert rule for an availability test

Deploy to Azure
This template creates an Application Insights availability test along with a metric alert rule that monitors it.

Terraform (AzAPI provider) resource definition

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

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Insights/metricAlerts@2018-03-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      actions = [
        {
          actionGroupId = "string"
          webHookProperties = {
            {customized property} = "string"
          }
        }
      ]
      autoMitigate = bool
      criteria = {
        odata.type = "string"
        // For remaining properties, see MetricAlertCriteria objects
      }
      description = "string"
      enabled = bool
      evaluationFrequency = "string"
      scopes = [
        "string"
      ]
      severity = int
      targetResourceRegion = "string"
      targetResourceType = "string"
      windowSize = "string"
    }
  })
}

MetricAlertCriteria objects

Set the odata.type property to specify the type of object.

For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:

  odata.type = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
  allOf = [
    {
      dimensions = [
        {
          name = "string"
          operator = "string"
          values = [
            "string"
          ]
        }
      ]
      metricName = "string"
      metricNamespace = "string"
      name = "string"
      skipMetricValidation = bool
      timeAggregation = "string"
      criterionType = "string"
      // For remaining properties, see MultiMetricCriteria objects
    }
  ]

For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:

  odata.type = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
  allOf = [
    {
      criterionType = "string"
      dimensions = [
        {
          name = "string"
          operator = "string"
          values = [
            "string"
          ]
        }
      ]
      metricName = "string"
      metricNamespace = "string"
      name = "string"
      operator = "string"
      skipMetricValidation = bool
      threshold = int
      timeAggregation = "string"
    }
  ]

For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:

  odata.type = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"
  componentId = "string"
  failedLocationCount = int
  webTestId = "string"

MultiMetricCriteria objects

Set the criterionType property to specify the type of object.

For DynamicThresholdCriterion, use:

  criterionType = "DynamicThresholdCriterion"
  alertSensitivity = "string"
  failingPeriods = {
    minFailingPeriodsToAlert = int
    numberOfEvaluationPeriods = int
  }
  ignoreDataBefore = "string"
  operator = "string"

For StaticThresholdCriterion, use:

  criterionType = "StaticThresholdCriterion"
  operator = "string"
  threshold = int

Property values

metricAlerts

Name Description Value
type The resource type "Microsoft.Insights/metricAlerts@2018-03-01"
name The resource name string (required)

Character limit: 1-260

Valid characters:
Can't use:
*#&+:<>?@%{}\/| or control characters

Can't end with space or period.
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 The alert rule properties of the resource. MetricAlertProperties (required)

MetricAlertProperties

Name Description Value
actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. MetricAlertAction[]
autoMitigate the flag that indicates whether the alert should be auto resolved or not. The default is true. bool
criteria defines the specific alert criteria information. MetricAlertCriteria (required)
description the description of the metric alert that will be included in the alert email. string
enabled the flag that indicates whether the metric alert is enabled. bool (required)
evaluationFrequency how often the metric alert is evaluated represented in ISO 8601 duration format. string (required)
scopes the list of resource id's that this metric alert is scoped to. string[] (required)
severity Alert severity {0, 1, 2, 3, 4} int (required)
targetResourceRegion the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. string
targetResourceType the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. string
windowSize the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. string (required)

MetricAlertAction

Name Description Value
actionGroupId the id of the action group to use. string
webHookProperties This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. MetricAlertActionWebHookProperties

MetricAlertActionWebHookProperties

Name Description Value
{customized property} string

MetricAlertCriteria

Name Description Value
odata.type Set the object type Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria (required)

MetricAlertMultipleResourceMultipleMetricCriteria

Name Description Value
odata.type specifies the type of the alert criteria. "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" (required)
allOf the list of multiple metric criteria for this 'all of' operation. MultiMetricCriteria[]

MultiMetricCriteria

Name Description Value
dimensions List of dimension conditions. MetricDimension[]
metricName Name of the metric. string (required)
metricNamespace Namespace of the metric. string
name Name of the criteria. string (required)
skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. bool
timeAggregation the criteria time aggregation types. "Average"
"Count"
"Maximum"
"Minimum"
"Total" (required)
criterionType Set the object type DynamicThresholdCriterion
StaticThresholdCriterion (required)

MetricDimension

Name Description Value
name Name of the dimension. string (required)
operator the dimension operator. Only 'Include' and 'Exclude' are supported string (required)
values list of dimension values. string[] (required)

DynamicMetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria "DynamicThresholdCriterion" (required)
alertSensitivity The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. "High"
"Low"
"Medium" (required)
failingPeriods The minimum number of violations required within the selected lookback time window required to raise an alert. DynamicThresholdFailingPeriods (required)
ignoreDataBefore Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) string
operator The operator used to compare the metric value against the threshold. "GreaterOrLessThan"
"GreaterThan"
"LessThan" (required)

DynamicThresholdFailingPeriods

Name Description Value
minFailingPeriodsToAlert The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. int (required)
numberOfEvaluationPeriods The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. int (required)

MetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria "DynamicThresholdCriterion"
"StaticThresholdCriterion" (required)
dimensions List of dimension conditions. MetricDimension[]
metricName Name of the metric. string (required)
metricNamespace Namespace of the metric. string
name Name of the criteria. string (required)
operator the criteria operator. "Equals"
"GreaterThan"
"GreaterThanOrEqual"
"LessThan"
"LessThanOrEqual" (required)
skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. bool
threshold the criteria threshold value that activates the alert. int (required)
timeAggregation the criteria time aggregation types. "Average"
"Count"
"Maximum"
"Minimum"
"Total" (required)
{customized property}

MetricAlertSingleResourceMultipleMetricCriteria

Name Description Value
odata.type specifies the type of the alert criteria. "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" (required)
allOf The list of metric criteria for this 'all of' operation. MetricCriteria[]

WebtestLocationAvailabilityCriteria

Name Description Value
odata.type specifies the type of the alert criteria. "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" (required)
componentId The Application Insights resource Id. string (required)
failedLocationCount The number of failed locations. int (required)
webTestId The Application Insights web test Id. string (required)