Microsoft.Insights metricAlerts 2018-03-01

Remarks

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

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.

Resource format

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

resource symbolicname 'Microsoft.Insights/metricAlerts@2018-03-01' = {
  location: 'string'
  name: 'string'
  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'
  }
  tags: {
    {customized property}: 'string'
  }
}

MetricAlertCriteria objects

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

For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:

{
  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
    }
  ]
  odata.type: 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
}

For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:

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

For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:

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

MultiMetricCriteria objects

Set the criterionType property to specify the type of object.

For DynamicThresholdCriterion, use:

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

For StaticThresholdCriterion, use:

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

Property values

DynamicMetricCriteria

Name Description Value
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)
criterionType Specifies the type of threshold criteria 'DynamicThresholdCriterion' (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)

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

MetricAlertCriteria

Name Description Value
odata.type Set to 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' for type MetricAlertMultipleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' for type MetricAlertSingleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' for type WebtestLocationAvailabilityCriteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required)

MetricAlertMultipleResourceMultipleMetricCriteria

Name Description Value
allOf the list of multiple metric criteria for this 'all of' operation. MultiMetricCriteria[]
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (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)

MetricAlertSingleResourceMultipleMetricCriteria

Name Description Value
allOf The list of metric criteria for this 'all of' operation. MetricCriteria[]
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (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)

MetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria 'StaticThresholdCriterion' (required)
operator the criteria operator. 'Equals'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual' (required)
threshold the criteria threshold value that activates the alert. int (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)

Microsoft.Insights/metricAlerts

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

MultiMetricCriteria

Name Description Value
criterionType Set to 'DynamicThresholdCriterion' for type DynamicMetricCriteria. Set to 'StaticThresholdCriterion' for type MetricCriteria. '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)
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)

ResourceTags

Name Description Value

WebtestLocationAvailabilityCriteria

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

Quickstart samples

The following quickstart samples deploy this resource type.

Bicep File Description
Deploy Application Insight and create alert in it This template allows you to deploy Application Insight and create alert in 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.

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

MetricAlertCriteria objects

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

For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:

{
  "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
  } ],
  "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
}

For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:

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

For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:

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

MultiMetricCriteria objects

Set the criterionType property to specify the type of object.

For DynamicThresholdCriterion, use:

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

For StaticThresholdCriterion, use:

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

Property values

DynamicMetricCriteria

Name Description Value
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)
criterionType Specifies the type of threshold criteria 'DynamicThresholdCriterion' (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)

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

MetricAlertCriteria

Name Description Value
odata.type Set to 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' for type MetricAlertMultipleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' for type MetricAlertSingleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' for type WebtestLocationAvailabilityCriteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required)

MetricAlertMultipleResourceMultipleMetricCriteria

Name Description Value
allOf the list of multiple metric criteria for this 'all of' operation. MultiMetricCriteria[]
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (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)

MetricAlertSingleResourceMultipleMetricCriteria

Name Description Value
allOf The list of metric criteria for this 'all of' operation. MetricCriteria[]
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (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)

MetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria 'StaticThresholdCriterion' (required)
operator the criteria operator. 'Equals'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual' (required)
threshold the criteria threshold value that activates the alert. int (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)

Microsoft.Insights/metricAlerts

Name Description Value
apiVersion The api version '2018-03-01'
location Resource location string (required)
name The resource name string (required)
properties The alert rule properties of the resource. MetricAlertProperties (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.Insights/metricAlerts'

MultiMetricCriteria

Name Description Value
criterionType Set to 'DynamicThresholdCriterion' for type DynamicMetricCriteria. Set to 'StaticThresholdCriterion' for type MetricCriteria. '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)
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)

ResourceTags

Name Description Value

WebtestLocationAvailabilityCriteria

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

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
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.
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.
Create alerts for your Application Gateway

Deploy to Azure
Use these templates to easily create some important event alerts for your Azure Application Gateway.
Deploy Application Insight and create alert in it

Deploy to Azure
This template allows you to deploy Application Insight and create alert in it
Dynamic Web Test Creation

Deploy to Azure
Create any number of App Insights web (ping) tests.
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.
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.
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.
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.

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"
  tags = {
    {customized property} = "string"
  }
  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:

{
  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
    }
  ]
  odata.type = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
}

For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:

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

For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:

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

MultiMetricCriteria objects

Set the criterionType property to specify the type of object.

For DynamicThresholdCriterion, use:

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

For StaticThresholdCriterion, use:

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

Property values

DynamicMetricCriteria

Name Description Value
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)
criterionType Specifies the type of threshold criteria 'DynamicThresholdCriterion' (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)

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

MetricAlertCriteria

Name Description Value
odata.type Set to 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' for type MetricAlertMultipleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' for type MetricAlertSingleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' for type WebtestLocationAvailabilityCriteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required)

MetricAlertMultipleResourceMultipleMetricCriteria

Name Description Value
allOf the list of multiple metric criteria for this 'all of' operation. MultiMetricCriteria[]
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (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)

MetricAlertSingleResourceMultipleMetricCriteria

Name Description Value
allOf The list of metric criteria for this 'all of' operation. MetricCriteria[]
odata.type specifies the type of the alert criteria. 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (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)

MetricCriteria

Name Description Value
criterionType Specifies the type of threshold criteria 'StaticThresholdCriterion' (required)
operator the criteria operator. 'Equals'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual' (required)
threshold the criteria threshold value that activates the alert. int (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)

Microsoft.Insights/metricAlerts

Name Description Value
location Resource location string (required)
name The resource name string (required)
properties The alert rule properties of the resource. MetricAlertProperties (required)
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.Insights/metricAlerts@2018-03-01"

MultiMetricCriteria

Name Description Value
criterionType Set to 'DynamicThresholdCriterion' for type DynamicMetricCriteria. Set to 'StaticThresholdCriterion' for type MetricCriteria. '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)
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)

ResourceTags

Name Description Value

WebtestLocationAvailabilityCriteria

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