Delen via


Metric Alerts - Create Or Update

Maak of werk een metrische waarschuwingsdefinitie aan.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}?api-version=2024-03-01-preview

URI-parameters

Name In Vereist Type Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

De naam van de resourcegroep. De naam is hoofdletterongevoelig.

ruleName
path True

string

De naam van de regel.

subscriptionId
path True

string

minLength: 1

De id van het doelabonnement.

api-version
query True

string

minLength: 1

De API-versie die voor deze bewerking moet worden gebruikt.

Aanvraagbody

Name Vereist Type Description
location True

string

Bronlocatie

properties.criteria True MetricAlertCriteria:

Definieert de specifieke informatie over de alarmcriteria.

properties.enabled True

boolean

De vlag die aangeeft of de metrische waarschuwing is ingeschakeld.

properties.evaluationFrequency True

string (duration)

Hoe vaak de metrische waarschuwing wordt geëvalueerd, weergegeven in de ISO 8601-duurindeling.

properties.scopes True

string[]

De lijst met resource-id's waarop deze metrische waarschuwing is gericht. U kunt het bereik van een metrische regel niet wijzigen op basis van logboeken.

properties.severity True

integer (int32)

Ernst van waarschuwing {0, 1, 2, 3, 4}

identity

Identity

De identiteit van de resource.

properties.actionProperties

object

De eigenschappen van een actie-eigenschappen.

properties.actions

MetricAlertAction[]

De matrix met acties die worden uitgevoerd wanneer de waarschuwingsregel actief wordt en wanneer een waarschuwingsvoorwaarde wordt opgelost.

properties.autoMitigate

boolean

De vlag die aangeeft of de waarschuwing automatisch moet worden opgelost of niet. De standaardwaarde is waar.

properties.customProperties

object

De eigenschappen van een nettolading van een waarschuwing.

properties.description

string

De beschrijving van de metrische waarschuwing die wordt opgenomen in de waarschuwingsmail.

properties.resolveConfiguration

ResolveConfiguration

De configuratie voor de manier waarop de waarschuwing wordt opgelost. Van toepassing op PromQLCriteria.

properties.targetResourceRegion

string

De regio van de doelbron(nen) waarop de waarschuwing is gemaakt/bijgewerkt. Verplicht als het bereik een abonnement, resourcegroep of meer dan één resource bevat.

properties.targetResourceType

string

Het resourcetype van de doelresource(s) waarop de waarschuwing is gemaakt/bijgewerkt. Verplicht als het bereik een abonnement, resourcegroep of meer dan één resource bevat.

properties.windowSize

string (duration)

De periode (in ISO 8601-duurformaat) die wordt gebruikt om waarschuwingsactiviteit te bewaken op basis van de drempelwaarde.

tags

object

Resourcetags

Antwoorden

Name Type Description
200 OK

MetricAlertResource

OK

Other Status Codes

ErrorResponse

Onjuiste aanvraag

Beveiliging

azure_auth

Azure Active Directory OAuth2-stroom

Type: oauth2
Stroom: implicit
Autorisatie-URL: https://login.microsoftonline.com/common/oauth2/authorize

Bereiken

Name Description
user_impersonation Uw gebruikersaccount imiteren

Voorbeelden

Create or update a dynamic alert rule for Multiple Resources
Create or update a dynamic alert rule for Single Resource
Create or update a query based alert rule
Create or update a query based alert rule with dynamic threshold
Create or update a resource centric query based alert rule
Create or update a resource centric query based alert rule for Multiple Resources
Create or update a web test alert rule
Create or update an alert rule for Multiple Resource
Create or update an alert rule for Single Resource
Create or update an alert rule on Resource group(s)
Create or update an alert rule on Subscription
Create or update an alert rules with dimensions

Create or update a dynamic alert rule for Multiple Resources

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/MetricAlertOnMultipleResources?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "DynamicThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "operator": "GreaterOrLessThan",
          "timeAggregation": "Average",
          "dimensions": [],
          "alertSensitivity": "Medium",
          "failingPeriods": {
            "numberOfEvaluationPeriods": 4,
            "minFailingPeriodsToAlert": 4
          }
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "DynamicThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "operator": "GreaterOrLessThan",
          "timeAggregation": "Average",
          "dimensions": [],
          "alertSensitivity": "Medium",
          "failingPeriods": {
            "numberOfEvaluationPeriods": 4,
            "minFailingPeriodsToAlert": 4
          }
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Create or update a dynamic alert rule for Single Resource

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "DynamicThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "operator": "GreaterOrLessThan",
          "timeAggregation": "Average",
          "dimensions": [],
          "alertSensitivity": "Medium",
          "failingPeriods": {
            "numberOfEvaluationPeriods": 4,
            "minFailingPeriodsToAlert": 4
          },
          "ignoreDataBefore": "2019-04-04T21:00:00.000Z"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "DynamicThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "operator": "GreaterOrLessThan",
          "timeAggregation": "Average",
          "dimensions": [],
          "alertSensitivity": "Medium",
          "failingPeriods": {
            "numberOfEvaluationPeriods": 4,
            "minFailingPeriodsToAlert": 4
          },
          "ignoreDataBefore": "2019-04-04T21:00:00.000Z"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Create or update a query based alert rule

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview

{
  "location": "eastus",
  "tags": {},
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {}
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT5M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) > 90"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "eastus",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "identity": {
    "type": "UserAssigned",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {
        "clientId": "778f4d04-3c60-4622-a839-5cf05866c983",
        "principalId": "669dd76d-cde8-4dc3-b882-1de566b0c628"
      }
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT2M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) > 90"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Create or update a query based alert rule with dynamic threshold

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview

{
  "location": "eastus",
  "tags": {},
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {}
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT5M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "DynamicThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"})",
          "operator": "LessThan",
          "alertSensitivity": "Medium",
          "ignoreDataBefore": "2019-04-04T21:00:00.000Z"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "eastus",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "identity": {
    "type": "UserAssigned",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {
        "clientId": "778f4d04-3c60-4622-a839-5cf05866c983",
        "principalId": "669dd76d-cde8-4dc3-b882-1de566b0c628"
      }
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT2M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "DynamicThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"})",
          "operator": "LessThan",
          "alertSensitivity": "Medium",
          "ignoreDataBefore": "2019-04-04T21:00:00.000Z"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Create or update a resource centric query based alert rule

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview

{
  "location": "eastus",
  "tags": {},
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {}
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.compute/virtualMachines/myVmName"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT5M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) > 90"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "eastus",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "identity": {
    "type": "UserAssigned",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {
        "clientId": "778f4d04-3c60-4622-a839-5cf05866c983",
        "principalId": "669dd76d-cde8-4dc3-b882-1de566b0c628"
      }
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.compute/virtualMachines/myVmName"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT2M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) > 90"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Create or update a resource centric query based alert rule for Multiple Resources

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview

{
  "location": "eastus",
  "tags": {},
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {}
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT5M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) by (\"microsoft.resourceid\") > 90"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "eastus",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "identity": {
    "type": "UserAssigned",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "userAssignedIdentities": {
      "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {
        "clientId": "778f4d04-3c60-4622-a839-5cf05866c983",
        "principalId": "669dd76d-cde8-4dc3-b882-1de566b0c628"
      }
    }
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"
    ],
    "evaluationFrequency": "PT1M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria",
      "failingPeriods": {
        "for": "PT2M"
      },
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) by (\"microsoft.resourceid\") > 90"
        }
      ]
    },
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    }
  }
}

Create or update a web test alert rule

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789101/resourceGroups/rg-example/providers/Microsoft.Insights/metricAlerts/webtest-name-example?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": "Resource",
    "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": "Resource"
  },
  "properties": {
    "description": "Automatically created alert rule for availability test \"component-example\" a",
    "enabled": true,
    "severity": 4,
    "windowSize": "PT15M",
    "evaluationFrequency": "PT1M",
    "criteria": {
      "failedLocationCount": 2,
      "webTestId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
      "componentId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
      "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"
    },
    "actions": [],
    "scopes": [
      "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
      "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example"
    ]
  }
}

Voorbeeldrespons

{
  "location": "global",
  "type": "Microsoft.Insights/metricAlerts",
  "name": "webtest-name-example",
  "id": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/metricalerts/webtest-name-example",
  "tags": {
    "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example": "Resource",
    "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example": "Resource"
  },
  "properties": {
    "description": "Automatically created alert rule for availability test \"webtest-name-example\" a",
    "severity": 4,
    "enabled": true,
    "scopes": [
      "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example",
      "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "criteria": {
      "webTestId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example",
      "componentId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example",
      "failedLocationCount": 2,
      "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"
    },
    "actions": []
  }
}

Create or update an alert rule for Multiple Resource

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/MetricAlertOnMultipleResources?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Create or update an alert rule for Single Resource

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "\\Processor(_Total)\\% Processor Time",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "\\Processor(_Total)\\% Processor Time",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Create or update an alert rule on Resource group(s)

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1/providers/Microsoft.Insights/metricAlerts/MetricAlertAtResourceGroupLevel?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1/providers/providers/microsoft.insights/metricalerts/MetricAlertAtResourceGroupLevel",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Create or update an alert rule on Subscription

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/MetricAlertAtSubscriptionLevel?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertAtSubscriptionLevel",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"
    ],
    "evaluationFrequency": "PT1M",
    "windowSize": "PT15M",
    "targetResourceType": "Microsoft.Compute/virtualMachines",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "criterionType": "StaticThresholdCriterion",
          "name": "High_CPU_80",
          "metricName": "Percentage CPU",
          "metricNamespace": "microsoft.compute/virtualmachines",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 80.5,
          "timeAggregation": "Average"
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Create or update an alert rules with dimensions

Voorbeeldaanvraag

PUT https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/MetricAlertOnMultipleDimensions?api-version=2024-03-01-preview

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "This is the description of the rule1",
    "enabled": true,
    "severity": 3,
    "windowSize": "P1D",
    "evaluationFrequency": "PT1H",
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"
    ],
    "criteria": {
      "allOf": [
        {
          "metricName": "Availability",
          "metricNamespace": "Microsoft.KeyVault/vaults",
          "operator": "GreaterThan",
          "timeAggregation": "Average",
          "name": "Metric1",
          "dimensions": [
            {
              "name": "ActivityName",
              "operator": "Include",
              "values": [
                "*"
              ]
            },
            {
              "name": "StatusCode",
              "operator": "Include",
              "values": [
                "200"
              ]
            }
          ],
          "criterionType": "StaticThresholdCriterion",
          "threshold": 55
        }
      ],
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ],
    "autoMitigate": true
  }
}

Voorbeeldrespons

{
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertWithDimensions",
  "type": "Microsoft.Insights/metricAlerts",
  "location": "global",
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  },
  "properties": {
    "description": "This is the description of the rule1",
    "severity": 3,
    "enabled": true,
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"
    ],
    "evaluationFrequency": "PT1H",
    "windowSize": "P1D",
    "targetResourceType": "Microsoft.KeyVault/vaults",
    "targetResourceRegion": "southcentralus",
    "criteria": {
      "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
      "allOf": [
        {
          "metricName": "Availability",
          "metricNamespace": "Microsoft.KeyVault/vaults",
          "operator": "GreaterThan",
          "timeAggregation": "Average",
          "name": "Metric1",
          "dimensions": [
            {
              "name": "ActivityName",
              "operator": "Include",
              "values": [
                "*"
              ]
            },
            {
              "name": "StatusCode",
              "operator": "Include",
              "values": [
                "200"
              ]
            }
          ],
          "criterionType": "StaticThresholdCriterion",
          "threshold": 55
        }
      ]
    },
    "autoMitigate": true,
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        "webHookProperties": {
          "key11": "value11",
          "key12": "value12"
        }
      }
    ]
  }
}

Definities

Name Description
AdditionalInfo

Een array van objecten met eigenschappen 'type' en 'info'. Het schema van 'info' is service-specifiek en afhankelijk van de 'type'-string.

AggregationTypeEnum

De criteria voor tijdaggregatietypen. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

DynamicMetricCriteria

Criterium voor dynamische drempel.

DynamicPromQLCriteria

Het criterium voor een dynamische prom-query.

DynamicThresholdFailingPeriods

Het minimale aantal schendingen dat is vereist in het geselecteerde tijdvenster voor terugkijken dat is vereist om een waarschuwing te genereren.

DynamicThresholdOperator

De operator die wordt gebruikt om de metrische waarde te vergelijken met de drempelwaarde. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

DynamicThresholdSensitivity

De mate van afwijking die is vereist voor het activeren van een waarschuwing. Dit is van invloed op hoe strak de drempelwaarde is voor het patroon van de metrische reeks. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Error
ErrorDetail

Beschrijft details van een foutrespons.

ErrorResponse

Beschrijft de indeling van foutreactie.

Identity

Identiteit voor de resource.

IdentityType

Type beheerde service-identiteit. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

MetricAlertAction

Een alarmactie.

MetricAlertMultipleResourceMultipleMetricCriteria

Specificeert de criteria voor metrische waarschuwingen voor meerdere bronnen die meerdere metriekcriteria hebben.

MetricAlertResource

De bron voor metriekwaarschuwingen.

MetricAlertSingleResourceMultipleMetricCriteria

Specificeert de criteria voor metrische waarschuwingen voor een enkele bron die meerdere metriekcriteria heeft.

MetricCriteria

Criterium om metrieken te filteren.

MetricDimension

Specificeert een metrische dimensie.

Operator

De criteriumoperator. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

PromQLCriteria

Specificeert de PromQL-criteria voor de metric alert-resource.

QueryFailingPeriods

Configuratie voor foutperioden in waarschuwingen op basis van query's.

ResolveConfiguration
StaticPromQLCriteria

Het criterium voor een statische prom-query.

UserIdentityProperties

Eigenschappen van de door de gebruiker toegewezen identiteit.

WebtestLocationAvailabilityCriteria

Specificeert de criteria voor de metrische waarschuwingsregel voor een webtestbron.

AdditionalInfo

Een array van objecten met eigenschappen 'type' en 'info'. Het schema van 'info' is service-specifiek en afhankelijk van de 'type'-string.

Name Type Description
info

De aanvullende informatie die specifiek is voor het type.

type

string

Het soort extra informatie.

AggregationTypeEnum

De criteria voor tijdaggregatietypen. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Waarde Description
Average
Count
Minimum
Maximum
Total

DynamicMetricCriteria

Criterium voor dynamische drempel.

Name Type Description
alertSensitivity

DynamicThresholdSensitivity

De mate van afwijking die is vereist voor het activeren van een waarschuwing. Dit is van invloed op hoe strak de drempelwaarde is voor het patroon van de metrische reeks. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

criterionType string:

DynamicThresholdCriterion

Hiermee geeft u het type drempelcriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

dimensions

MetricDimension[]

Lijst met dimensievoorwaarden.

failingPeriods

DynamicThresholdFailingPeriods

Het minimale aantal schendingen dat is vereist in het geselecteerde tijdvenster voor terugkijken dat is vereist om een waarschuwing te genereren.

ignoreDataBefore

string (date-time)

Gebruik deze optie om de datum in te stellen van waaruit u de historische metrische gegevens wilt leren en de dynamische drempelwaarden (in ISO8601 notatie) wilt berekenen

metricName

string

Naam van de metrische waarde.

metricNamespace

string

Naamruimte van de metrische waarde.

name

string

Naam van de criteria.

operator

DynamicThresholdOperator

De operator die wordt gebruikt om de metrische waarde te vergelijken met de drempelwaarde. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

skipMetricValidation

boolean

Hiermee kunt u een waarschuwingsregel maken voor een aangepaste metrische waarde die nog niet is verzonden, door ervoor te zorgen dat de metrische validatie wordt overgeslagen.

timeAggregation

AggregationTypeEnum

De criteria voor tijdaggregatietypen. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

DynamicPromQLCriteria

Het criterium voor een dynamische prom-query.

Name Type Description
alertSensitivity

DynamicThresholdSensitivity

De mate van afwijking die is vereist voor het activeren van een waarschuwing. Dit is van invloed op hoe strak de drempelwaarde is voor het patroon van de metrische reeks. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

criterionType string:

DynamicThresholdCriterion

Hiermee geeft u het type drempelcriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

ignoreDataBefore

string (date-time)

Gebruik deze optie om de datum in te stellen van waaruit u de historische metrische gegevens wilt leren en de dynamische drempelwaarden (in ISO8601 notatie) wilt berekenen

name

string

Naam van de criteria.

operator

DynamicThresholdOperator

De operator die wordt gebruikt om de metrische waarde te vergelijken met de drempelwaarde. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

query

string

De query die wordt gebruikt om de waarschuwingsregel te evalueren

DynamicThresholdFailingPeriods

Het minimale aantal schendingen dat is vereist in het geselecteerde tijdvenster voor terugkijken dat is vereist om een waarschuwing te genereren.

Name Type Description
minFailingPeriodsToAlert

number

Het aantal schendingen dat een waarschuwing activeert. Moet kleiner of gelijk zijn aan numberOfEvaluationPeriods.

numberOfEvaluationPeriods

number

Het aantal geaggregeerde lookbackpunten. Het tijdvenster voor lookback wordt berekend op basis van de aggregatiegranulariteit (windowSize) en het geselecteerde aantal geaggregeerde punten.

DynamicThresholdOperator

De operator die wordt gebruikt om de metrische waarde te vergelijken met de drempelwaarde. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Waarde Description
GreaterThan
LessThan
GreaterOrLessThan

DynamicThresholdSensitivity

De mate van afwijking die is vereist voor het activeren van een waarschuwing. Dit is van invloed op hoe strak de drempelwaarde is voor het patroon van de metrische reeks. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Waarde Description
Low
Medium
High

Error

Name Type Description
additionalInfo

AdditionalInfo[]

Een array van objecten met eigenschappen 'type' en 'info'. Het schema van 'info' is service-specifiek en afhankelijk van de 'type'-string.

code

string

Niet-gelokaliseerde string die kan worden gebruikt om de fout programmatisch te identificeren.

details

ErrorDetail[]

Een matrix met aanvullende geneste informatieobjecten voor foutreacties, zoals beschreven in dit contract.

message

string

Beschrijft de fout in detail en geeft informatie over debugging. Als Accept-Language in het verzoek is ingesteld, moet het gelokaliseerd zijn naar die taal.

target

string

Het doel van de specifieke fout (bijvoorbeeld de naam van de eigenschap in fout).

ErrorDetail

Beschrijft details van een foutrespons.

Name Type Description
additionalInfo

AdditionalInfo[]

Een array van objecten met eigenschappen 'type' en 'info'. Het schema van 'info' is service-specifiek en afhankelijk van de 'type'-string.

code

string

Niet-gelokaliseerde string die kan worden gebruikt om de fout programmatisch te identificeren.

message

string

Beschrijft de fout in detail en geeft informatie over debugging.

target

string

Het doel van de specifieke fout (bijvoorbeeld de naam van de eigenschap in fout).

ErrorResponse

Beschrijft de indeling van foutreactie.

Name Type Description
error

Error

Identity

Identiteit voor de resource.

Name Type Description
principalId

string

De principal-id van de resource-id.

tenantId

string

De tenant-id van de resource.

type

IdentityType

Type beheerde service-identiteit. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

userAssignedIdentities

<string,  UserIdentityProperties>

De lijst met gebruikersidentiteiten die zijn gekoppeld aan de resource. De sleutelverwijzingen in het woordenboek voor gebruikersidentiteit zijn Azure-resource-id's in de vorm: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

IdentityType

Type beheerde service-identiteit. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Waarde Description
SystemAssigned
UserAssigned
None

MetricAlertAction

Een alarmactie.

Name Type Description
actionGroupId

string

De id van de actiegroep die je moet gebruiken.

webHookProperties

object

Met dit veld kunt u aangepaste eigenschappen opgeven, die worden toegevoegd aan de nettolading van de waarschuwing die als invoer naar de webhook wordt verzonden.

MetricAlertMultipleResourceMultipleMetricCriteria

Specificeert de criteria voor metrische waarschuwingen voor meerdere bronnen die meerdere metriekcriteria hebben.

Name Type Description
allOf MultiMetricCriteria[]:

De lijst met meerdere metrische criteria voor deze 'alle' operatie.

odata.type string:

Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria

Hiermee geeft u het type waarschuwingscriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

MetricAlertResource

De bron voor metriekwaarschuwingen.

Name Type Description
id

string

Azure-resource-id

identity

Identity

De identiteit van de resource.

location

string

Bronlocatie

name

string

Azure-resourcenaam

properties.actionProperties

object

De eigenschappen van een actie-eigenschappen.

properties.actions

MetricAlertAction[]

De matrix met acties die worden uitgevoerd wanneer de waarschuwingsregel actief wordt en wanneer een waarschuwingsvoorwaarde wordt opgelost.

properties.autoMitigate

boolean

De vlag die aangeeft of de waarschuwing automatisch moet worden opgelost of niet. De standaardwaarde is waar.

properties.criteria MetricAlertCriteria:

Definieert de specifieke informatie over de alarmcriteria.

properties.customProperties

object

De eigenschappen van een nettolading van een waarschuwing.

properties.description

string

De beschrijving van de metrische waarschuwing die wordt opgenomen in de waarschuwingsmail.

properties.enabled

boolean

De vlag die aangeeft of de metrische waarschuwing is ingeschakeld.

properties.evaluationFrequency

string (duration)

Hoe vaak de metrische waarschuwing wordt geëvalueerd, weergegeven in de ISO 8601-duurindeling.

properties.isMigrated

boolean

De waarde geeft aan of deze waarschuwingsregel is gemigreerd.

properties.lastUpdatedTime

string (date-time)

De vorige keer werd de regel in ISO8601 formaat bijgewerkt.

properties.resolveConfiguration

ResolveConfiguration

De configuratie voor de manier waarop de waarschuwing wordt opgelost. Van toepassing op PromQLCriteria.

properties.scopes

string[]

De lijst met resource-id's waarop deze metrische waarschuwing is gericht. U kunt het bereik van een metrische regel niet wijzigen op basis van logboeken.

properties.severity

integer (int32)

Ernst van waarschuwing {0, 1, 2, 3, 4}

properties.targetResourceRegion

string

De regio van de doelbron(nen) waarop de waarschuwing is gemaakt/bijgewerkt. Verplicht als het bereik een abonnement, resourcegroep of meer dan één resource bevat.

properties.targetResourceType

string

Het resourcetype van de doelresource(s) waarop de waarschuwing is gemaakt/bijgewerkt. Verplicht als het bereik een abonnement, resourcegroep of meer dan één resource bevat.

properties.windowSize

string (duration)

De periode (in ISO 8601-duurformaat) die wordt gebruikt om waarschuwingsactiviteit te bewaken op basis van de drempelwaarde.

tags

object

Resourcetags

type

string

Type Azure-resource

MetricAlertSingleResourceMultipleMetricCriteria

Specificeert de criteria voor metrische waarschuwingen voor een enkele bron die meerdere metriekcriteria heeft.

Name Type Description
allOf

MetricCriteria[]

De lijst met metrische criteria voor deze 'all'-bewerking.

odata.type string:

Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria

Hiermee geeft u het type waarschuwingscriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

MetricCriteria

Criterium om metrieken te filteren.

Name Type Description
criterionType string:

StaticThresholdCriterion

Hiermee geeft u het type drempelcriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

dimensions

MetricDimension[]

Lijst met dimensievoorwaarden.

metricName

string

Naam van de metrische waarde.

metricNamespace

string

Naamruimte van de metrische waarde.

name

string

Naam van de criteria.

operator

Operator

De criteriumoperator. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

skipMetricValidation

boolean

Hiermee kunt u een waarschuwingsregel maken voor een aangepaste metrische waarde die nog niet is verzonden, door ervoor te zorgen dat de metrische validatie wordt overgeslagen.

threshold

number (double)

De drempelwaarde voor het criterium waarmee de waarschuwing wordt geactiveerd.

timeAggregation

AggregationTypeEnum

De criteria voor tijdaggregatietypen. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

MetricDimension

Specificeert een metrische dimensie.

Name Type Description
name

string

Naam van de dimensie.

operator

string

De dimensieoperator. Alleen Opnemen en Uitsluiten worden ondersteund

values

string[]

Lijst met dimensiewaarden.

Operator

De criteriumoperator. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Waarde Description
Equals
GreaterThan
GreaterThanOrEqual
LessThan
LessThanOrEqual

PromQLCriteria

Specificeert de PromQL-criteria voor de metric alert-resource.

Name Type Description
allOf MultiPromQLCriteria[]:

De lijst met promQL-criteria. Er wordt alarm geslagen wanneer aan alle voorwaarden is voldaan.

failingPeriods

QueryFailingPeriods

Configuratie voor foutperioden in waarschuwingen op basis van query's.

odata.type string:

Microsoft.Azure.Monitor.PromQLCriteria

Hiermee geeft u het type waarschuwingscriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

QueryFailingPeriods

Configuratie voor foutperioden in waarschuwingen op basis van query's.

Name Type Description
for

string (duration)

De tijdsduur (in ISO 8601-duurformaat) alert moet actief zijn voordat er wordt afgevuurd.

ResolveConfiguration

Name Type Description
autoResolved

boolean

Geeft aan of de waarschuwing automatisch moet worden opgelost

timeToResolve

string (duration)

De tijd (in ISO 8601-duurformaat) waarna de waarschuwing automatisch moet worden opgelost

StaticPromQLCriteria

Het criterium voor een statische prom-query.

Name Type Description
criterionType string:

StaticThresholdCriterion

Hiermee geeft u het type drempelcriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

name

string

Naam van de criteria.

query

string

De query die wordt gebruikt om de waarschuwingsregel te evalueren

UserIdentityProperties

Eigenschappen van de door de gebruiker toegewezen identiteit.

Name Type Description
clientId

string

De client-ID van resource-identiteit.

principalId

string

De principal-id van de resource-id.

WebtestLocationAvailabilityCriteria

Specificeert de criteria voor de metrische waarschuwingsregel voor een webtestbron.

Name Type Description
componentId

string

De Application Insights-resource-id.

failedLocationCount

number

Het aantal mislukte locaties.

odata.type string:

Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria

Hiermee geeft u het type waarschuwingscriteria op. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

webTestId

string

De Application Insights-webtest-id.