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

De geografische locatie waar de resource zich bevindt

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

Microsoft.Common.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

De updateoperatie van de bron 'MetricAlertResource' is geslaagd

Other Status Codes

MetricAlertErrorResponse

Een onverwachte foutreactie.

Beveiliging

azure_auth

Azure Active Directory OAuth2 Flow.

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

Voorbeeldrespons

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

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

Voorbeeldrespons

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

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

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

Voorbeeldrespons

{
  "type": "Microsoft.Insights/metricAlerts",
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "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"
      }
    }
  },
  "location": "eastus",
  "properties": {
    "description": "This is the description of the rule1",
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "criteria": {
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) > 90"
        }
      ],
      "failingPeriods": {
        "for": "PT2M"
      },
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    },
    "enabled": true,
    "evaluationFrequency": "PT1M",
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"
    ],
    "severity": 3
  },
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  }
}

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

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

Voorbeeldrespons

{
  "type": "Microsoft.Insights/metricAlerts",
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "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"
      }
    }
  },
  "location": "eastus",
  "properties": {
    "description": "This is the description of the rule1",
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "criteria": {
      "allOf": [
        {
          "name": "Metric1",
          "alertSensitivity": "Medium",
          "criterionType": "DynamicThresholdCriterion",
          "ignoreDataBefore": "2019-04-04T21:00:00.000Z",
          "operator": "LessThan",
          "query": "avg({\"system.cpu.utilization\"})"
        }
      ],
      "failingPeriods": {
        "for": "PT2M"
      },
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    },
    "enabled": true,
    "evaluationFrequency": "PT1M",
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"
    ],
    "severity": 3
  },
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  }
}

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

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

Voorbeeldrespons

{
  "type": "Microsoft.Insights/metricAlerts",
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "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"
      }
    }
  },
  "location": "eastus",
  "properties": {
    "description": "This is the description of the rule1",
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "criteria": {
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) > 90"
        }
      ],
      "failingPeriods": {
        "for": "PT2M"
      },
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    },
    "enabled": true,
    "evaluationFrequency": "PT1M",
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.compute/virtualMachines/myVmName"
    ],
    "severity": 3
  },
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  }
}

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

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

Voorbeeldrespons

{
  "type": "Microsoft.Insights/metricAlerts",
  "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin",
  "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"
      }
    }
  },
  "location": "eastus",
  "properties": {
    "description": "This is the description of the rule1",
    "actionProperties": {
      "Email.Sujbect": "my custom email subject"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"
      }
    ],
    "criteria": {
      "allOf": [
        {
          "name": "Metric1",
          "criterionType": "StaticThresholdCriterion",
          "query": "avg({\"system.cpu.utilization\"}) by (\"microsoft.resourceid\") > 90"
        }
      ],
      "failingPeriods": {
        "for": "PT2M"
      },
      "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria"
    },
    "customProperties": {
      "key11": "value11",
      "key12": "value12"
    },
    "enabled": true,
    "evaluationFrequency": "PT1M",
    "resolveConfiguration": {
      "autoResolved": true,
      "timeToResolve": "PT10M"
    },
    "scopes": [
      "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"
    ],
    "severity": 3
  },
  "tags": {
    "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
  }
}

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

Voorbeeldrespons

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

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

Voorbeeldrespons

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

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

Voorbeeldrespons

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

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

Voorbeeldrespons

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

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

Voorbeeldrespons

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

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

Voorbeeldrespons

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

Definities

Name Description
AggregationTypeEnum

De criteria voor tijdaggregatietypen. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

createdByType

Het type identiteit waarmee de resource is gemaakt.

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

IdentityType

Type beheerde service-identiteit.

MetricAlertAction

Een alarmactie.

MetricAlertErrorResponse

Beschrijft de indeling van foutreactie.

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.

Microsoft.Common.ErrorDetail

Beschrijft details van een foutrespons.

Microsoft.Common.ErrorDetailAdditionalInfoItem
Microsoft.Common.ErrorResponseError
Microsoft.Common.ErrorResponseErrorAdditionalInfoItem
Microsoft.Common.Identity

Identiteit voor de resource.

Microsoft.Common.UserIdentityProperties

Eigenschappen van de door de gebruiker toegewezen identiteit.

Odatatype

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

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.

systemData

Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.

WebtestLocationAvailabilityCriteria

Specificeert de criteria voor de metrische waarschuwingsregel voor een webtestbron.

AggregationTypeEnum

De criteria voor tijdaggregatietypen. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Waarde Description
Average

Gemiddeld

Count

Aantal

Minimum

Minimaal

Maximum

Maximum

Total

Total

createdByType

Het type identiteit waarmee de resource is gemaakt.

Waarde Description
User
Application
ManagedIdentity
Key

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 (float)

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

numberOfEvaluationPeriods

number (float)

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

GreaterThan

LessThan

LessThan

GreaterOrLessThan

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

Low

Medium

Medium

High

Hoog

IdentityType

Type beheerde service-identiteit.

Waarde Description
SystemAssigned

SysteemToegewezen

UserAssigned

UserAssigned

None

Geen

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.

MetricAlertErrorResponse

Beschrijft de indeling van foutreactie.

Name Type Description
error

Microsoft.Common.ErrorResponseError

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

Volledig gekwalificeerde resource-id voor de resource. Vb.: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

identity

Microsoft.Common.Identity

De identiteit van de resource.

location

string

De geografische locatie waar de resource zich bevindt

name

string

De naam 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.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.

systemData

systemData

Azure Resource Manager-metagegevens met createdBy- en modifiedBy-gegevens.

tags

object

Resourcetags.

type

string

Het type bron. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'

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.

Microsoft.Common.ErrorDetail

Beschrijft details van een foutrespons.

Name Type Description
additionalInfo

Microsoft.Common.ErrorDetailAdditionalInfoItem[]

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).

Microsoft.Common.ErrorDetailAdditionalInfoItem

Name Type Description
info

De aanvullende informatie die specifiek is voor het type.

type

string

Het soort extra informatie.

Microsoft.Common.ErrorResponseError

Name Type Description
additionalInfo

Microsoft.Common.ErrorResponseErrorAdditionalInfoItem[]

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

Microsoft.Common.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).

Microsoft.Common.ErrorResponseErrorAdditionalInfoItem

Name Type Description
info

De aanvullende informatie die specifiek is voor het type.

type

string

Het soort extra informatie.

Microsoft.Common.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.

userAssignedIdentities

<string,  Microsoft.Common.UserIdentityProperties>

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

Microsoft.Common.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.

Odatatype

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

Waarde Description
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria

Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria

Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria

Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria

Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria

Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria

Microsoft.Azure.Monitor.PromQLCriteria

Microsoft.Azure.Monitor.PromQLCriteria

Operator

De criteriumoperator. Eerder ongedocumenteerde waarden kunnen worden geretourneerd

Waarde Description
Equals

Gelijk aan

GreaterThan

GreaterThan

GreaterThanOrEqual

GreaterThanOrEqual (GroterDanOfGelijkAan)

LessThan

LessThan

LessThanOrEqual

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

systemData

Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.

Name Type Description
createdAt

string (date-time)

De tijdstempel van het maken van resources (UTC).

createdBy

string

De identiteit waarmee de resource is gemaakt.

createdByType

createdByType

Het type identiteit waarmee de resource is gemaakt.

lastModifiedAt

string (date-time)

De tijdstempel van de laatste wijziging van de resource (UTC)

lastModifiedBy

string

De identiteit die de resource voor het laatst heeft gewijzigd.

lastModifiedByType

createdByType

Het type identiteit dat de resource voor het laatst heeft gewijzigd.

WebtestLocationAvailabilityCriteria

Specificeert de criteria voor de metrische waarschuwingsregel voor een webtestbron.

Name Type Description
componentId

string

De Application Insights-resource-id.

failedLocationCount

number (float)

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.