Metric Alerts - Create Or Update

Bir metrik uyarı tanımı oluşturun veya güncelleyin.

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

URI Parametreleri

Name İçinde Gerekli Tür Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

Kaynak grubunun adı. Ad büyük/küçük harfe duyarsız.

ruleName
path True

string

Kuralın adı.

subscriptionId
path True

string

minLength: 1

Hedef aboneliğin kimliği.

api-version
query True

string

minLength: 1

Bu işlem için kullanılacak API sürümü.

İstek Gövdesi

Name Gerekli Tür Description
location True

string

Kaynağın bulunduğu coğrafi konum

properties.criteria True MetricAlertCriteria:

Belirli uyarı ölçütü bilgilerini tanımlar.

properties.enabled True

boolean

Ölçüm uyarısının etkinleştirilip etkinleştirilmediğini gösteren bayrak.

properties.evaluationFrequency True

string (duration)

Ölçüm uyarısının ne sıklıkta değerlendirildiği ISO 8601 süre biçiminde gösterilir.

properties.scopes True

string[]

Bu ölçüm uyarısının kapsamının belirlendiği kaynak kimliklerinin listesi. Günlükleri temel alan bir ölçüm kuralının kapsamını değiştiremezsiniz.

properties.severity True

integer (int32)

Uyarı önem derecesi {0, 1, 2, 3, 4}

identity

Microsoft.Common.Identity

Kaynağın kimliği.

properties.actionProperties

object

Eylem özelliklerinin özellikleri.

properties.actions

MetricAlertAction[]

Uyarı kuralı etkin olduğunda ve bir uyarı koşulu çözümlendiğinde gerçekleştirilen eylemler dizisi.

properties.autoMitigate

boolean

Uyarının otomatik olarak çözümlenmesi gerekip gerekmediğini gösteren bayrak. Varsayılan değer true'dur.

properties.customProperties

object

Uyarı yükünün özellikleri.

properties.description

string

Uyarı e-postasına eklenecek ölçüm uyarısının açıklaması.

properties.resolveConfiguration

ResolveConfiguration

Uyarının nasıl çözümlendiğine ilişkin yapılandırma. PromQLCriteria için geçerlidir.

properties.targetResourceRegion

string

Uyarının oluşturulduğu/güncelleştirildiği hedef kaynakların bölgesi. Kapsam bir abonelik, kaynak grubu veya birden fazla kaynak içeriyorsa zorunlu.

properties.targetResourceType

string

Uyarının oluşturulduğu/güncelleştirildiği hedef kaynakların kaynak türü. Kapsam bir abonelik, kaynak grubu veya birden fazla kaynak içeriyorsa zorunlu.

properties.windowSize

string (duration)

Eşiğe göre uyarı etkinliğini izlemek için kullanılan süre (ISO 8601 süre biçiminde).

tags

object

Kaynak etiketleri.

Yanıtlar

Name Tür Description
200 OK

MetricAlertResource

Kaynak 'MetricAlertResource' güncelleme işlemi başarılı oldu

Other Status Codes

MetricAlertErrorResponse

Beklenmeyen bir hata yanıtı.

Güvenlik

azure_auth

Azure Active Directory OAuth2 Flow.

Tür: oauth2
Akış: implicit
Yetkilendirme URL’si: https://login.microsoftonline.com/common/oauth2/authorize

Kapsamlar

Name Description
user_impersonation kullanıcı hesabınızın kimliğine bürünme

Örnekler

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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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"
  }
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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)

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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

Örnek isteği

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": {}
}

Örnek yanıt

{
  "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"
  }
}

Tanımlar

Name Description
AggregationTypeEnum

Ölçüt zaman toplama türleri. Daha önce belgelenmemiş değerler döndürülebilir

createdByType

Kaynağı oluşturan kimliğin türü.

DynamicMetricCriteria

Dinamik eşik için kriter.

DynamicPromQLCriteria

Dinamik mezuniyet dili sorgusu için kriter.

DynamicThresholdFailingPeriods

Uyarı göndermek için gereken, seçilen geri arama zaman penceresinde gereken en düşük ihlal sayısı.

DynamicThresholdOperator

Ölçüm değerini eşikle karşılaştırmak için kullanılan işleç. Daha önce belgelenmemiş değerler döndürülebilir

DynamicThresholdSensitivity

Uyarı tetikleme için gereken sapma kapsamı. Bu, eşiğin ölçüm serisi düzenine ne kadar sıkı olduğunu etkiler. Daha önce belgelenmemiş değerler döndürülebilir

IdentityType

Yönetilen hizmet kimliği türü.

MetricAlertAction

Bir uyarı eylemi.

MetricAlertErrorResponse

Hata yanıtının biçimini açıklar.

MetricAlertMultipleResourceMultipleMetricCriteria

Birden fazla metrik kriterine sahip birden fazla kaynak için metrik uyarı kriterlerini belirtir.

MetricAlertResource

Metrik uyarı kaynağı.

MetricAlertSingleResourceMultipleMetricCriteria

Birden fazla metrik kriterine sahip tek bir kaynak için metrik uyarı kriterlerini belirtir.

MetricCriteria

Ölçütleri filtrelemek için kriterler.

MetricDimension

Bir metrik boyut belirtir.

Microsoft.Common.ErrorDetail

Hata yanıtının detaylarını açıklar.

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

Kaynağın kimliği.

Microsoft.Common.UserIdentityProperties

Kullanıcı tarafından atanan kimliğin özellikleri.

Odatatype

Uyarı ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

Operator

Ölçüt işleci. Daha önce belgelenmemiş değerler döndürülebilir

PromQLCriteria

Metrik uyarı kaynağı için PromQL kriterlerini belirtir.

QueryFailingPeriods

Sorgu tabanlı uyarılarda başarısız dönemler için yapılandırma.

ResolveConfiguration
StaticPromQLCriteria

Statik balo sorgusu için kriter.

systemData

Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.

WebtestLocationAvailabilityCriteria

Bir web test kaynağı için metrik uyarı kuralı kriterlerini belirler.

AggregationTypeEnum

Ölçüt zaman toplama türleri. Daha önce belgelenmemiş değerler döndürülebilir

Değer Description
Average

Average

Count

Count

Minimum

En Küçük

Maximum

Maximum

Total

Total

createdByType

Kaynağı oluşturan kimliğin türü.

Değer Description
User
Application
ManagedIdentity
Key

DynamicMetricCriteria

Dinamik eşik için kriter.

Name Tür Description
alertSensitivity

DynamicThresholdSensitivity

Uyarı tetikleme için gereken sapma kapsamı. Bu, eşiğin ölçüm serisi düzenine ne kadar sıkı olduğunu etkiler. Daha önce belgelenmemiş değerler döndürülebilir

criterionType string:

DynamicThresholdCriterion

Eşik ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

dimensions

MetricDimension[]

Boyut koşullarının listesi.

failingPeriods

DynamicThresholdFailingPeriods

Uyarı göndermek için gereken, seçilen geri arama zaman penceresinde gereken en düşük ihlal sayısı.

ignoreDataBefore

string (date-time)

Ölçüm geçmiş verilerini öğrenmeye başlayacağınız tarihi ayarlamak ve dinamik eşikleri hesaplamak için bu seçeneği kullanın (ISO8601 biçimde)

metricName

string

Ölçümün adı.

metricNamespace

string

Ölçümün ad alanı.

name

string

Ölçüt adı.

operator

DynamicThresholdOperator

Ölçüm değerini eşikle karşılaştırmak için kullanılan işleç. Daha önce belgelenmemiş değerler döndürülebilir

skipMetricValidation

boolean

Uyarı kuralı oluşturmanın, henüz üretilmemiş bir özel ölçüm üzerinde, ölçüm doğrulamasını atlayarak yapılmasına izin verir.

timeAggregation

AggregationTypeEnum

Ölçüt zaman toplama türleri. Daha önce belgelenmemiş değerler döndürülebilir

DynamicPromQLCriteria

Dinamik mezuniyet dili sorgusu için kriter.

Name Tür Description
alertSensitivity

DynamicThresholdSensitivity

Uyarı tetikleme için gereken sapma kapsamı. Bu, eşiğin ölçüm serisi düzenine ne kadar sıkı olduğunu etkiler. Daha önce belgelenmemiş değerler döndürülebilir

criterionType string:

DynamicThresholdCriterion

Eşik ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

ignoreDataBefore

string (date-time)

Ölçüm geçmiş verilerini öğrenmeye başlayacağınız tarihi ayarlamak ve dinamik eşikleri hesaplamak için bu seçeneği kullanın (ISO8601 biçimde)

name

string

Ölçüt adı.

operator

DynamicThresholdOperator

Ölçüm değerini eşikle karşılaştırmak için kullanılan işleç. Daha önce belgelenmemiş değerler döndürülebilir

query

string

Uyarı kuralını değerlendirmek için kullanılan sorgu

DynamicThresholdFailingPeriods

Uyarı göndermek için gereken, seçilen geri arama zaman penceresinde gereken en düşük ihlal sayısı.

Name Tür Description
minFailingPeriodsToAlert

number (float)

Uyarı tetikleme ihlallerinin sayısı. NumberOfEvaluationPeriods değerine eşit veya daha küçük olmalıdır.

numberOfEvaluationPeriods

number (float)

Toplanan geri arama noktalarının sayısı. Geri arama zamanı penceresi toplama ayrıntı düzeyi (windowSize) ve seçili toplanan nokta sayısına göre hesaplanır.

DynamicThresholdOperator

Ölçüm değerini eşikle karşılaştırmak için kullanılan işleç. Daha önce belgelenmemiş değerler döndürülebilir

Değer Description
GreaterThan

GreaterThan

LessThan

LessThan

GreaterOrLessThan

BüyükYa KüçükOlur

DynamicThresholdSensitivity

Uyarı tetikleme için gereken sapma kapsamı. Bu, eşiğin ölçüm serisi düzenine ne kadar sıkı olduğunu etkiler. Daha önce belgelenmemiş değerler döndürülebilir

Değer Description
Low

Low

Medium

Medium

High

Yüksek

IdentityType

Yönetilen hizmet kimliği türü.

Değer Description
SystemAssigned

Sistem Ataması

UserAssigned

UserAssigned

None

Hiçbiri

MetricAlertAction

Bir uyarı eylemi.

Name Tür Description
actionGroupId

string

Kullanılacak eylem grubunun kimliği.

webHookProperties

object

Bu alan, web kancasına giriş olarak gönderilen uyarı yüküne eklenecek özel özelliklerin belirtilmesine olanak tanır.

MetricAlertErrorResponse

Hata yanıtının biçimini açıklar.

Name Tür Description
error

Microsoft.Common.ErrorResponseError

MetricAlertMultipleResourceMultipleMetricCriteria

Birden fazla metrik kriterine sahip birden fazla kaynak için metrik uyarı kriterlerini belirtir.

Name Tür Description
allOf MultiMetricCriteria[]:

Bu 'tümü' işlemi için birden çok ölçüm ölçütünün listesi.

odata.type string:

Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria

Uyarı ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

MetricAlertResource

Metrik uyarı kaynağı.

Name Tür Description
id

string

Kaynağın tam kaynak kimliği. Örn - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

identity

Microsoft.Common.Identity

Kaynağın kimliği.

location

string

Kaynağın bulunduğu coğrafi konum

name

string

Kaynağın adı

properties.actionProperties

object

Eylem özelliklerinin özellikleri.

properties.actions

MetricAlertAction[]

Uyarı kuralı etkin olduğunda ve bir uyarı koşulu çözümlendiğinde gerçekleştirilen eylemler dizisi.

properties.autoMitigate

boolean

Uyarının otomatik olarak çözümlenmesi gerekip gerekmediğini gösteren bayrak. Varsayılan değer true'dur.

properties.criteria MetricAlertCriteria:

Belirli uyarı ölçütü bilgilerini tanımlar.

properties.customProperties

object

Uyarı yükünün özellikleri.

properties.description

string

Uyarı e-postasına eklenecek ölçüm uyarısının açıklaması.

properties.enabled

boolean

Ölçüm uyarısının etkinleştirilip etkinleştirilmediğini gösteren bayrak.

properties.evaluationFrequency

string (duration)

Ölçüm uyarısının ne sıklıkta değerlendirildiği ISO 8601 süre biçiminde gösterilir.

properties.isMigrated

boolean

Bu uyarı kuralının taşınıp taşınmadığını gösteren değer.

properties.lastUpdatedTime

string (date-time)

Kural en son ISO8601 formatta güncellenmişti.

properties.resolveConfiguration

ResolveConfiguration

Uyarının nasıl çözümlendiğine ilişkin yapılandırma. PromQLCriteria için geçerlidir.

properties.scopes

string[]

Bu ölçüm uyarısının kapsamının belirlendiği kaynak kimliklerinin listesi. Günlükleri temel alan bir ölçüm kuralının kapsamını değiştiremezsiniz.

properties.severity

integer (int32)

Uyarı önem derecesi {0, 1, 2, 3, 4}

properties.targetResourceRegion

string

Uyarının oluşturulduğu/güncelleştirildiği hedef kaynakların bölgesi. Kapsam bir abonelik, kaynak grubu veya birden fazla kaynak içeriyorsa zorunlu.

properties.targetResourceType

string

Uyarının oluşturulduğu/güncelleştirildiği hedef kaynakların kaynak türü. Kapsam bir abonelik, kaynak grubu veya birden fazla kaynak içeriyorsa zorunlu.

properties.windowSize

string (duration)

Eşiğe göre uyarı etkinliğini izlemek için kullanılan süre (ISO 8601 süre biçiminde).

systemData

systemData

createdBy ve modifiedBy bilgilerini içeren Azure Resource Manager meta verileri.

tags

object

Kaynak etiketleri.

type

string

Kaynağın türü. Örneğin "Microsoft. Compute/virtualMachines" veya "Microsoft. Depo/Depolama Hesapları"

MetricAlertSingleResourceMultipleMetricCriteria

Birden fazla metrik kriterine sahip tek bir kaynak için metrik uyarı kriterlerini belirtir.

Name Tür Description
allOf

MetricCriteria[]

Bu 'tümü' işlemi için ölçüm ölçütlerinin listesi.

odata.type string:

Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria

Uyarı ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

MetricCriteria

Ölçütleri filtrelemek için kriterler.

Name Tür Description
criterionType string:

StaticThresholdCriterion

Eşik ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

dimensions

MetricDimension[]

Boyut koşullarının listesi.

metricName

string

Ölçümün adı.

metricNamespace

string

Ölçümün ad alanı.

name

string

Ölçüt adı.

operator

Operator

Ölçüt işleci. Daha önce belgelenmemiş değerler döndürülebilir

skipMetricValidation

boolean

Uyarı kuralı oluşturmanın, henüz üretilmemiş bir özel ölçüm üzerinde, ölçüm doğrulamasını atlayarak yapılmasına izin verir.

threshold

number (double)

Uyarıyı etkinleştiren ölçüt eşik değeri.

timeAggregation

AggregationTypeEnum

Ölçüt zaman toplama türleri. Daha önce belgelenmemiş değerler döndürülebilir

MetricDimension

Bir metrik boyut belirtir.

Name Tür Description
name

string

Boyutun adı.

operator

string

Boyut işleci. Yalnızca 'Dahil Et' ve 'Dışla' desteklenir

values

string[]

Boyut değerlerinin listesi.

Microsoft.Common.ErrorDetail

Hata yanıtının detaylarını açıklar.

Name Tür Description
additionalInfo

Microsoft.Common.ErrorDetailAdditionalInfoItem[]

'Type' ve 'info' özelliklerine sahip bir nesne dizisi. 'Bilgi' şeması servise özgüdür ve 'type' dizisine bağlıdır.

code

string

Hatayı programatik olarak tanımlamak için kullanılabilen lokalize edilmemiş dizidir.

message

string

Hatayı ayrıntılı olarak tanımlar ve hata ayıklama bilgisi sağlar.

target

string

Belirli bir hatanın hedefi (örneğin, hatalı özelliğin adı).

Microsoft.Common.ErrorDetailAdditionalInfoItem

Name Tür Description
info

Tipe özgü ek bilgiler.

type

string

Ek bilgi türü.

Microsoft.Common.ErrorResponseError

Name Tür Description
additionalInfo

Microsoft.Common.ErrorResponseErrorAdditionalInfoItem[]

'Type' ve 'info' özelliklerine sahip bir nesne dizisi. 'Bilgi' şeması servise özgüdür ve 'type' dizisine bağlıdır.

code

string

Hatayı programatik olarak tanımlamak için kullanılabilen lokalize edilmemiş dizidir.

details

Microsoft.Common.ErrorDetail[]

Bu sözleşmede açıklandığı gibi ek iç içe hata yanıtı bilgi nesneleri dizisi.

message

string

Hatayı ayrıntılı olarak tanımlar ve hata ayıklama bilgisi sağlar. Eğer Accept-Language istekte ayarlanmışsa, o dile yerelleştirilmelidir.

target

string

Belirli bir hatanın hedefi (örneğin, hatalı özelliğin adı).

Microsoft.Common.ErrorResponseErrorAdditionalInfoItem

Name Tür Description
info

Tipe özgü ek bilgiler.

type

string

Ek bilgi türü.

Microsoft.Common.Identity

Kaynağın kimliği.

Name Tür Description
principalId

string

Kaynak kimliğinin asıl kimliği.

tenantId

string

Kaynağın kiracı kimliği.

type

IdentityType

Yönetilen hizmet kimliği türü.

userAssignedIdentities

<string,  Microsoft.Common.UserIdentityProperties>

Kaynakla ilişkilendirilmiş kullanıcı kimliklerinin listesi. Kullanıcı kimliği sözlük anahtarı başvuruları şu biçimde ARM kaynak kimlikleri olacaktır: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

Microsoft.Common.UserIdentityProperties

Kullanıcı tarafından atanan kimliğin özellikleri.

Name Tür Description
clientId

string

Kaynak kimliğinin istemci kimliği.

principalId

string

Kaynak kimliğinin asıl kimliği.

Odatatype

Uyarı ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

Değer 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

Ölçüt işleci. Daha önce belgelenmemiş değerler döndürülebilir

Değer Description
Equals

Eşittir

GreaterThan

GreaterThan

GreaterThanOrEqual

GreaterThanOrEqual

LessThan

LessThan

LessThanOrEqual

LessThanOrEqual

PromQLCriteria

Metrik uyarı kaynağı için PromQL kriterlerini belirtir.

Name Tür Description
allOf MultiPromQLCriteria[]:

PromQL kriterlerinin listesi. Tüm koşullar karşılandığında uyarı verilecektir.

failingPeriods

QueryFailingPeriods

Sorgu tabanlı uyarılarda başarısız dönemler için yapılandırma.

odata.type string:

Microsoft.Azure.Monitor.PromQLCriteria

Uyarı ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

QueryFailingPeriods

Sorgu tabanlı uyarılarda başarısız dönemler için yapılandırma.

Name Tür Description
for

string (duration)

Tetiklemeden önce süre (ISO 8601 süre biçiminde) uyarısının etkin olması gerekir.

ResolveConfiguration

Name Tür Description
autoResolved

boolean

Uyarının otomatik olarak çözümlenmesi gerekip gerekmediğini gösterir

timeToResolve

string (duration)

Uyarının otomatik olarak çözümlenmesi gereken süre (ISO 8601 süre biçiminde)

StaticPromQLCriteria

Statik balo sorgusu için kriter.

Name Tür Description
criterionType string:

StaticThresholdCriterion

Eşik ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

name

string

Ölçüt adı.

query

string

Uyarı kuralını değerlendirmek için kullanılan sorgu

systemData

Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.

Name Tür Description
createdAt

string (date-time)

Kaynak oluşturma (UTC) zaman damgası.

createdBy

string

Kaynağı oluşturan kimlik.

createdByType

createdByType

Kaynağı oluşturan kimliğin türü.

lastModifiedAt

string (date-time)

Kaynağın son değişikliğinin zaman damgası (UTC)

lastModifiedBy

string

Kaynağı en son değiştiren kimlik.

lastModifiedByType

createdByType

Kaynağı en son değiştiren kimlik türü.

WebtestLocationAvailabilityCriteria

Bir web test kaynağı için metrik uyarı kuralı kriterlerini belirler.

Name Tür Description
componentId

string

Application Insights kaynak kimliği.

failedLocationCount

number (float)

Başarısız konumların sayısı.

odata.type string:

Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria

Uyarı ölçütlerinin türünü belirtir. Daha önce belgelenmemiş değerler döndürülebilir

webTestId

string

Application Insights web testi kimliği.