diff --git a/model_diff.txt b/model_diff.txt new file mode 100644 index 000000000000..af004bb1811b --- /dev/null +++ b/model_diff.txt @@ -0,0 +1,20 @@ +diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/models.tsp b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/models.tsp +index afa609a76f..aa8a61242f 100644 +--- a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/models.tsp ++++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/models.tsp +@@ -340,15 +340,6 @@ model Resource { + identity?: Identity; + } + +-/** +- * Describes the format of Error response. +- */ +-@error +-model MetricAlertErrorResponse { +- #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +- error?: ErrorResponseError; +-} +- + /** + * The metric alert resource for patch operations. + */ diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/MetricAlertResource.tsp b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/MetricAlertResource.tsp index f1366d95d79b..cef408417c80 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/MetricAlertResource.tsp +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/MetricAlertResource.tsp @@ -69,18 +69,16 @@ interface MetricAlertResources { get is ArmResourceRead; /** - * Create or update an metric alert definition. + * Create or update a metric alert definition. */ - #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @tag("MetricAlerts") createOrUpdate is ArmResourceCreateOrReplaceSync< MetricAlertResource, - Response = ArmResourceUpdatedResponse, Error = MetricAlertErrorResponse >; /** - * Update an metric alert definition. + * Update a metric alert definition. */ @patch(#{ implicitOptionality: false }) @tag("MetricAlerts") diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/UpdateMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/UpdateMetricAlert.json new file mode 100644 index 000000000000..563bbfbef909 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/UpdateMetricAlert.json @@ -0,0 +1,94 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Update", + "title": "Create or update an alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateDynamicMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateDynamicMetricAlertMultipleResource.json new file mode 100644 index 000000000000..80dbb2fa67bb --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateDynamicMetricAlertMultipleResource.json @@ -0,0 +1,164 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a dynamic alert rule for Multiple Resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateDynamicMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateDynamicMetricAlertSingleResource.json new file mode 100644 index 000000000000..26dbfc957695 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateDynamicMetricAlertSingleResource.json @@ -0,0 +1,162 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a dynamic alert rule for Single Resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertMultipleResource.json new file mode 100644 index 000000000000..dc2d99529610 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertMultipleResource.json @@ -0,0 +1,152 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule for Multiple Resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQuery.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQuery.json new file mode 100644 index 000000000000..0a4695f2d970 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQuery.json @@ -0,0 +1,178 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a query based alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryDT.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryDT.json new file mode 100644 index 000000000000..005c41a9209d --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryDT.json @@ -0,0 +1,187 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a query based alert rule with dynamic threshold" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryMultiResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryMultiResource.json new file mode 100644 index 000000000000..affe24872108 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryMultiResource.json @@ -0,0 +1,178 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a resource centric query based alert rule for Multiple Resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryResourceCentric.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryResourceCentric.json new file mode 100644 index 000000000000..c8a35b412d2f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertQueryResourceCentric.json @@ -0,0 +1,178 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a resource centric query based alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertResourceGroup.json new file mode 100644 index 000000000000..fefa92514cec --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertResourceGroup.json @@ -0,0 +1,152 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest1", + "ruleName": "MetricAlertAtResourceGroupLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule on Resource group(s)" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertSingleResource.json new file mode 100644 index 000000000000..7b0f20961cbb --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertSingleResource.json @@ -0,0 +1,140 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule for Single Resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertSubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertSubscription.json new file mode 100644 index 000000000000..539411d43452 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertSubscription.json @@ -0,0 +1,149 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertAtSubscriptionLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule on Subscription" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertWithDimensions.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertWithDimensions.json new file mode 100644 index 000000000000..dc67c83216f6 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateMetricAlertWithDimensions.json @@ -0,0 +1,192 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleDimensions", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rules with dimensions" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateWebTestMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateWebTestMetricAlert.json new file mode 100644 index 000000000000..7a8b64f64ddf --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/createOrUpdateWebTestMetricAlert.json @@ -0,0 +1,99 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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" + } + }, + "resourceGroupName": "rg-example", + "ruleName": "webtest-name-example", + "subscriptionId": "12345678-1234-1234-1234-123456789101" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a web test alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/deleteMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/deleteMetricAlert.json new file mode 100644 index 000000000000..a7af169be157 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/deleteMetricAlert.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": {}, + "204": {} + }, + "operationId": "MetricAlerts_Delete", + "title": "Delete an alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getDynamicMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getDynamicMetricAlertMultipleResource.json new file mode 100644 index 000000000000..bf6feaec906f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getDynamicMetricAlertMultipleResource.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a dynamic alert rule for multiple resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getDynamicMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getDynamicMetricAlertSingleResource.json new file mode 100644 index 000000000000..35468eec43b4 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getDynamicMetricAlertSingleResource.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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": false, + "criteria": { + "allOf": [ + { + "name": "High_CPU_80", + "alertSensitivity": "Medium", + "criterionType": "DynamicThresholdCriterion", + "dimensions": [], + "failingPeriods": { + "minFailingPeriodsToAlert": 4, + "numberOfEvaluationPeriods": 4 + }, + "ignoreDataBefore": null, + "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": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a dynamic alert rule for single resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertMultipleResource.json new file mode 100644 index 000000000000..bdc6eb99a643 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertMultipleResource.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule for multiple resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertQuery.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertQuery.json new file mode 100644 index 000000000000..cbfb504ed9d5 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertQuery.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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", + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "Metric1", + "criterionType": "StaticThresholdCriterion", + "query": "floor(minute(vector(time())) / 10 ) % 2 == 1" + } + ], + "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria" + }, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a query based alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertResourceGroup.json new file mode 100644 index 000000000000..857c46563dcf --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertResourceGroup.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest1", + "ruleName": "MetricAlertAtResourceGroupLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule on resource group(s)" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertSingleResource.json new file mode 100644 index 000000000000..cd93bf73fed4 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertSingleResource.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule for single resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertStatus.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertStatus.json new file mode 100644 index 000000000000..13c70a5149fc --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertStatus.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/LeoAlert_custom1", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlertsStatus_List", + "title": "Get an alert rule status" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertStatusByName.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertStatusByName.json new file mode 100644 index 000000000000..88017eb016ac --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertStatusByName.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "EastUs", + "ruleName": "custom1", + "statusName": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "subscriptionId": "009f6022-67ec-423e-9aa7-691182870588" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/custom1", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlertsStatus_ListByName", + "title": "Get an alert rule status" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertSubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertSubscription.json new file mode 100644 index 000000000000..c09c80d702a7 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getMetricAlertSubscription.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertAtSubscriptionLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule on subscription" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getWebTestMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getWebTestMetricAlert.json new file mode 100644 index 000000000000..c11a2ffccb8f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/getWebTestMetricAlert.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "rg-example", + "ruleName": "webtest-name-example", + "subscriptionId": "12345678-1234-1234-1234-123456789101" + }, + "responses": { + "200": { + "body": { + "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\"", + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a web test alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/listByResourceGroupMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/listByResourceGroupMetricAlert.json new file mode 100644 index 000000000000..c4b7cf12c68e --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/listByResourceGroupMetricAlert.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/highcpu", + "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" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "High_CPU_80", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\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" + } + }, + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/mediumcpu", + "location": "global", + "properties": { + "description": "Med cpu alert", + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "Medium_CPU_50", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\Processor(_Total)\\% Processor Time", + "operator": "GreaterThan", + "threshold": 50.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": 4, + "windowSize": "PT15M" + }, + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_ListByResourceGroup", + "title": "List metric alert rules" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/listMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/listMetricAlert.json new file mode 100644 index 000000000000..6e3391fd0ac3 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/examples/2026-01-01/listMetricAlert.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/highcpu", + "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" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "High_CPU_80", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\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" + } + }, + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/mediumcpu", + "location": "global", + "properties": { + "description": "Med cpu alert", + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "Medium_CPU_50", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\Processor(_Total)\\% Processor Time", + "operator": "GreaterThan", + "threshold": 50.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": 4, + "windowSize": "PT15M" + }, + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_ListBySubscription", + "title": "List metric alert rules" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/main.tsp b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/main.tsp index ee64c71e7d29..d0793e8e67fd 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/main.tsp +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/MetricAlertApi/main.tsp @@ -41,4 +41,9 @@ enum Versions { * The 2024-03-01-preview API version. */ v2024_03_01_preview: "2024-03-01-preview", + + /** + * The 2026-01-01 API version. + */ + v2026_01_01: "2026-01-01", } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/readme.md b/specification/monitor/resource-manager/Microsoft.Insights/Insights/readme.md index b7b5781c8119..4b746a368083 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/Insights/readme.md +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/readme.md @@ -32,7 +32,6 @@ title: MonitorClient description: Monitor Management Client openapi-type: arm openapi-subtype: rpaas -tag: package-2025-08 directive: - suppress: Example Validations reason: "There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off." @@ -53,13 +52,22 @@ input-file: - stable/2016-03-01/logProfiles.json - stable/2024-02-01/metrics.json - stable/2026-01-01/activityLogAlerts_API.json - - preview/2024-03-01-preview/metricAlert.json + - stable/2026-01-01/metricAlert.json - stable/2026-03-01/scheduledQueryRule_API.json - stable/2019-03-01/metricBaselines.json - preview/2024-10-01-preview/actionGroups.json - stable/2021-10-01/networkSecurityPerimeter.json ``` +### Tag: package-2026-01-01 + +These settings apply only when `--tag=package-2026-01-01` is specified on the command line. + +```yaml $(tag) == 'package-2026-01-01' +input-file: + - stable/2026-01-01/metricAlert.json +``` + ### Tag: package-2026-03-01 These settings apply only when `--tag=package-2026-03-01` is specified on the command line. diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/UpdateMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/UpdateMetricAlert.json new file mode 100644 index 000000000000..563bbfbef909 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/UpdateMetricAlert.json @@ -0,0 +1,94 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Update", + "title": "Create or update an alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json new file mode 100644 index 000000000000..80dbb2fa67bb --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json @@ -0,0 +1,164 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a dynamic alert rule for Multiple Resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json new file mode 100644 index 000000000000..26dbfc957695 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json @@ -0,0 +1,162 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a dynamic alert rule for Single Resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertMultipleResource.json new file mode 100644 index 000000000000..dc2d99529610 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertMultipleResource.json @@ -0,0 +1,152 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule for Multiple Resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQuery.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQuery.json new file mode 100644 index 000000000000..0a4695f2d970 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQuery.json @@ -0,0 +1,178 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a query based alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryDT.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryDT.json new file mode 100644 index 000000000000..005c41a9209d --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryDT.json @@ -0,0 +1,187 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a query based alert rule with dynamic threshold" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryMultiResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryMultiResource.json new file mode 100644 index 000000000000..affe24872108 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryMultiResource.json @@ -0,0 +1,178 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a resource centric query based alert rule for Multiple Resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryResourceCentric.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryResourceCentric.json new file mode 100644 index 000000000000..c8a35b412d2f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertQueryResourceCentric.json @@ -0,0 +1,178 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a resource centric query based alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertResourceGroup.json new file mode 100644 index 000000000000..fefa92514cec --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertResourceGroup.json @@ -0,0 +1,152 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest1", + "ruleName": "MetricAlertAtResourceGroupLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule on Resource group(s)" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertSingleResource.json new file mode 100644 index 000000000000..7b0f20961cbb --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertSingleResource.json @@ -0,0 +1,140 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule for Single Resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertSubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertSubscription.json new file mode 100644 index 000000000000..539411d43452 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertSubscription.json @@ -0,0 +1,149 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertAtSubscriptionLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rule on Subscription" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertWithDimensions.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertWithDimensions.json new file mode 100644 index 000000000000..dc67c83216f6 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateMetricAlertWithDimensions.json @@ -0,0 +1,192 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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": {} + }, + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleDimensions", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update an alert rules with dimensions" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateWebTestMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateWebTestMetricAlert.json new file mode 100644 index 000000000000..7a8b64f64ddf --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/createOrUpdateWebTestMetricAlert.json @@ -0,0 +1,99 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "parameters": { + "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" + } + }, + "resourceGroupName": "rg-example", + "ruleName": "webtest-name-example", + "subscriptionId": "12345678-1234-1234-1234-123456789101" + }, + "responses": { + "200": { + "body": { + "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" + } + }, + "headers": {} + }, + "201": { + "body": { + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_CreateOrUpdate", + "title": "Create or update a web test alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/deleteMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/deleteMetricAlert.json new file mode 100644 index 000000000000..a7af169be157 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/deleteMetricAlert.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": {}, + "204": {} + }, + "operationId": "MetricAlerts_Delete", + "title": "Delete an alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getDynamicMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getDynamicMetricAlertMultipleResource.json new file mode 100644 index 000000000000..bf6feaec906f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getDynamicMetricAlertMultipleResource.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a dynamic alert rule for multiple resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getDynamicMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getDynamicMetricAlertSingleResource.json new file mode 100644 index 000000000000..35468eec43b4 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getDynamicMetricAlertSingleResource.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "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": false, + "criteria": { + "allOf": [ + { + "name": "High_CPU_80", + "alertSensitivity": "Medium", + "criterionType": "DynamicThresholdCriterion", + "dimensions": [], + "failingPeriods": { + "minFailingPeriodsToAlert": 4, + "numberOfEvaluationPeriods": 4 + }, + "ignoreDataBefore": null, + "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": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a dynamic alert rule for single resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertMultipleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertMultipleResource.json new file mode 100644 index 000000000000..bdc6eb99a643 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertMultipleResource.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertOnMultipleResources", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule for multiple resources" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertQuery.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertQuery.json new file mode 100644 index 000000000000..cbfb504ed9d5 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertQuery.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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", + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "Metric1", + "criterionType": "StaticThresholdCriterion", + "query": "floor(minute(vector(time())) / 10 ) % 2 == 1" + } + ], + "odata.type": "Microsoft.Azure.Monitor.PromQLCriteria" + }, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a query based alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertResourceGroup.json new file mode 100644 index 000000000000..857c46563dcf --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertResourceGroup.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest1", + "ruleName": "MetricAlertAtResourceGroupLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule on resource group(s)" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertSingleResource.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertSingleResource.json new file mode 100644 index 000000000000..cd93bf73fed4 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertSingleResource.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule for single resource" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertStatus.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertStatus.json new file mode 100644 index 000000000000..13c70a5149fc --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertStatus.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/LeoAlert_custom1", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlertsStatus_List", + "title": "Get an alert rule status" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertStatusByName.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertStatusByName.json new file mode 100644 index 000000000000..88017eb016ac --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertStatusByName.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "EastUs", + "ruleName": "custom1", + "statusName": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "subscriptionId": "009f6022-67ec-423e-9aa7-691182870588" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/custom1", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlertsStatus_ListByName", + "title": "Get an alert rule status" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertSubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertSubscription.json new file mode 100644 index 000000000000..c09c80d702a7 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getMetricAlertSubscription.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "ruleName": "MetricAlertAtSubscriptionLevel", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "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": false, + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get an alert rule on subscription" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getWebTestMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getWebTestMetricAlert.json new file mode 100644 index 000000000000..c11a2ffccb8f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/getWebTestMetricAlert.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "rg-example", + "ruleName": "webtest-name-example", + "subscriptionId": "12345678-1234-1234-1234-123456789101" + }, + "responses": { + "200": { + "body": { + "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\"", + "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" + } + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_Get", + "title": "Get a web test alert rule" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/listByResourceGroupMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/listByResourceGroupMetricAlert.json new file mode 100644 index 000000000000..c4b7cf12c68e --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/listByResourceGroupMetricAlert.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/highcpu", + "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" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "High_CPU_80", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\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" + } + }, + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/mediumcpu", + "location": "global", + "properties": { + "description": "Med cpu alert", + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "Medium_CPU_50", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\Processor(_Total)\\% Processor Time", + "operator": "GreaterThan", + "threshold": 50.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": 4, + "windowSize": "PT15M" + }, + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_ListByResourceGroup", + "title": "List metric alert rules" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/listMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/listMetricAlert.json new file mode 100644 index 000000000000..6e3391fd0ac3 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/examples/listMetricAlert.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "api-version": "2026-01-01", + "resourceGroupName": "gigtest", + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/highcpu", + "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" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "High_CPU_80", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\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" + } + }, + { + "type": "Microsoft.Insights/metricAlerts", + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/mediumcpu", + "location": "global", + "properties": { + "description": "Med cpu alert", + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ], + "criteria": { + "allOf": [ + { + "name": "Medium_CPU_50", + "criterionType": "StaticThresholdCriterion", + "dimensions": [], + "metricName": "CustomMetric_\\Processor(_Total)\\% Processor Time", + "operator": "GreaterThan", + "threshold": 50.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": 4, + "windowSize": "PT15M" + }, + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "MetricAlerts_ListBySubscription", + "title": "List metric alert rules" +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/metricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/metricAlert.json new file mode 100644 index 000000000000..969aa1dd319f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/metricAlert.json @@ -0,0 +1,1556 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorManagementClient", + "version": "2026-01-01", + "description": "Azure Monitor client to create/update/delete metric based alerts.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "MetricAlerts" + }, + { + "name": "MetricAlertsStatus" + } + ], + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts": { + "get": { + "operationId": "MetricAlerts_ListBySubscription", + "tags": [ + "MetricAlerts" + ], + "description": "Retrieve alert rule definitions in a subscription.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/MetricAlertResourceCollection" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "List metric alert rules": { + "$ref": "./examples/listMetricAlert.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts": { + "get": { + "operationId": "MetricAlerts_ListByResourceGroup", + "tags": [ + "MetricAlerts" + ], + "description": "Retrieve alert rule definitions in a resource group.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/MetricAlertResourceCollection" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "List metric alert rules": { + "$ref": "./examples/listByResourceGroupMetricAlert.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}": { + "get": { + "operationId": "MetricAlerts_Get", + "tags": [ + "MetricAlerts" + ], + "description": "Retrieve an alert rule definition.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "ruleName", + "in": "path", + "description": "The name of the rule.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/MetricAlertResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a dynamic alert rule for multiple resources": { + "$ref": "./examples/getDynamicMetricAlertMultipleResource.json" + }, + "Get a dynamic alert rule for single resource": { + "$ref": "./examples/getDynamicMetricAlertSingleResource.json" + }, + "Get a query based alert rule": { + "$ref": "./examples/getMetricAlertQuery.json" + }, + "Get a web test alert rule": { + "$ref": "./examples/getWebTestMetricAlert.json" + }, + "Get an alert rule for multiple resources": { + "$ref": "./examples/getMetricAlertMultipleResource.json" + }, + "Get an alert rule for single resource": { + "$ref": "./examples/getMetricAlertSingleResource.json" + }, + "Get an alert rule on resource group(s)": { + "$ref": "./examples/getMetricAlertResourceGroup.json" + }, + "Get an alert rule on subscription": { + "$ref": "./examples/getMetricAlertSubscription.json" + } + } + }, + "put": { + "operationId": "MetricAlerts_CreateOrUpdate", + "tags": [ + "MetricAlerts" + ], + "description": "Create or update a metric alert definition.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "ruleName", + "in": "path", + "description": "The name of the rule.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The parameters of the rule to create or update.", + "required": true, + "schema": { + "$ref": "#/definitions/MetricAlertResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'MetricAlertResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/MetricAlertResource" + } + }, + "201": { + "description": "Resource 'MetricAlertResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/MetricAlertResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a dynamic alert rule for Multiple Resources": { + "$ref": "./examples/createOrUpdateDynamicMetricAlertMultipleResource.json" + }, + "Create or update a dynamic alert rule for Single Resource": { + "$ref": "./examples/createOrUpdateDynamicMetricAlertSingleResource.json" + }, + "Create or update a query based alert rule": { + "$ref": "./examples/createOrUpdateMetricAlertQuery.json" + }, + "Create or update a query based alert rule with dynamic threshold": { + "$ref": "./examples/createOrUpdateMetricAlertQueryDT.json" + }, + "Create or update a resource centric query based alert rule": { + "$ref": "./examples/createOrUpdateMetricAlertQueryResourceCentric.json" + }, + "Create or update a resource centric query based alert rule for Multiple Resources": { + "$ref": "./examples/createOrUpdateMetricAlertQueryMultiResource.json" + }, + "Create or update a web test alert rule": { + "$ref": "./examples/createOrUpdateWebTestMetricAlert.json" + }, + "Create or update an alert rule for Multiple Resource": { + "$ref": "./examples/createOrUpdateMetricAlertMultipleResource.json" + }, + "Create or update an alert rule for Single Resource": { + "$ref": "./examples/createOrUpdateMetricAlertSingleResource.json" + }, + "Create or update an alert rule on Resource group(s)": { + "$ref": "./examples/createOrUpdateMetricAlertResourceGroup.json" + }, + "Create or update an alert rule on Subscription": { + "$ref": "./examples/createOrUpdateMetricAlertSubscription.json" + }, + "Create or update an alert rules with dimensions": { + "$ref": "./examples/createOrUpdateMetricAlertWithDimensions.json" + } + } + }, + "patch": { + "operationId": "MetricAlerts_Update", + "tags": [ + "MetricAlerts" + ], + "description": "Update a metric alert definition.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "ruleName", + "in": "path", + "description": "The name of the rule.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The parameters of the rule to update.", + "required": true, + "schema": { + "$ref": "#/definitions/MetricAlertResourcePatch" + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/MetricAlertResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update an alert rule": { + "$ref": "./examples/UpdateMetricAlert.json" + } + } + }, + "delete": { + "operationId": "MetricAlerts_Delete", + "tags": [ + "MetricAlerts" + ], + "description": "Delete an alert rule definition.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "ruleName", + "in": "path", + "description": "The name of the rule.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete an alert rule": { + "$ref": "./examples/deleteMetricAlert.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status": { + "get": { + "operationId": "MetricAlertsStatus_List", + "tags": [ + "MetricAlertsStatus" + ], + "description": "Retrieve an alert rule status.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "ruleName", + "in": "path", + "description": "The name of the rule.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/MetricAlertStatusCollection" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "Get an alert rule status": { + "$ref": "./examples/getMetricAlertStatus.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}": { + "get": { + "operationId": "MetricAlertsStatus_ListByName", + "tags": [ + "MetricAlertsStatus" + ], + "description": "Retrieve an alert rule status.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "ruleName", + "in": "path", + "description": "The name of the rule.", + "required": true, + "type": "string" + }, + { + "name": "statusName", + "in": "path", + "description": "The name of the status.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/MetricAlertStatusCollection" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/MetricAlertErrorResponse" + } + } + }, + "x-ms-examples": { + "Get an alert rule status": { + "$ref": "./examples/getMetricAlertStatusByName.json" + } + } + } + } + }, + "definitions": { + "AggregationTypeEnum": { + "type": "string", + "description": "The criteria time aggregation types. Previously undocumented values might be returned", + "enum": [ + "Average", + "Count", + "Minimum", + "Maximum", + "Total" + ], + "x-ms-enum": { + "name": "AggregationTypeEnum", + "modelAsString": true, + "values": [ + { + "name": "Average", + "value": "Average", + "description": "Average" + }, + { + "name": "Count", + "value": "Count", + "description": "Count" + }, + { + "name": "Minimum", + "value": "Minimum", + "description": "Minimum" + }, + { + "name": "Maximum", + "value": "Maximum", + "description": "Maximum" + }, + { + "name": "Total", + "value": "Total", + "description": "Total" + } + ] + } + }, + "DynamicMetricCriteria": { + "type": "object", + "description": "Criterion for dynamic threshold.", + "properties": { + "operator": { + "$ref": "#/definitions/DynamicThresholdOperator", + "description": "The operator used to compare the metric value against the threshold. Previously undocumented values might be returned" + }, + "alertSensitivity": { + "$ref": "#/definitions/DynamicThresholdSensitivity", + "description": "The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. Previously undocumented values might be returned" + }, + "failingPeriods": { + "$ref": "#/definitions/DynamicThresholdFailingPeriods", + "description": "The minimum number of violations required within the selected lookback time window required to raise an alert." + }, + "ignoreDataBefore": { + "type": "string", + "format": "date-time", + "description": "Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)" + } + }, + "required": [ + "operator", + "alertSensitivity", + "failingPeriods" + ], + "allOf": [ + { + "$ref": "#/definitions/MultiMetricCriteria" + } + ], + "x-ms-discriminator-value": "DynamicThresholdCriterion" + }, + "DynamicPromQLCriteria": { + "type": "object", + "description": "The criterion for dynamic prom query.", + "properties": { + "operator": { + "$ref": "#/definitions/DynamicThresholdOperator", + "description": "The operator used to compare the metric value against the threshold. Previously undocumented values might be returned" + }, + "alertSensitivity": { + "$ref": "#/definitions/DynamicThresholdSensitivity", + "description": "The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. Previously undocumented values might be returned" + }, + "ignoreDataBefore": { + "type": "string", + "format": "date-time", + "description": "Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)" + } + }, + "required": [ + "operator", + "alertSensitivity" + ], + "allOf": [ + { + "$ref": "#/definitions/MultiPromQLCriteria" + } + ], + "x-ms-discriminator-value": "DynamicThresholdCriterion" + }, + "DynamicThresholdFailingPeriods": { + "type": "object", + "description": "The minimum number of violations required within the selected lookback time window required to raise an alert.", + "properties": { + "numberOfEvaluationPeriods": { + "type": "number", + "format": "float", + "description": "The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points." + }, + "minFailingPeriodsToAlert": { + "type": "number", + "format": "float", + "description": "The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods." + } + }, + "required": [ + "numberOfEvaluationPeriods", + "minFailingPeriodsToAlert" + ] + }, + "DynamicThresholdOperator": { + "type": "string", + "description": "The operator used to compare the metric value against the threshold. Previously undocumented values might be returned", + "enum": [ + "GreaterThan", + "LessThan", + "GreaterOrLessThan" + ], + "x-ms-enum": { + "name": "DynamicThresholdOperator", + "modelAsString": true, + "values": [ + { + "name": "GreaterThan", + "value": "GreaterThan", + "description": "GreaterThan" + }, + { + "name": "LessThan", + "value": "LessThan", + "description": "LessThan" + }, + { + "name": "GreaterOrLessThan", + "value": "GreaterOrLessThan", + "description": "GreaterOrLessThan" + } + ] + } + }, + "DynamicThresholdSensitivity": { + "type": "string", + "description": "The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. Previously undocumented values might be returned", + "enum": [ + "Low", + "Medium", + "High" + ], + "x-ms-enum": { + "name": "DynamicThresholdSensitivity", + "modelAsString": true, + "values": [ + { + "name": "Low", + "value": "Low", + "description": "Low" + }, + { + "name": "Medium", + "value": "Medium", + "description": "Medium" + }, + { + "name": "High", + "value": "High", + "description": "High" + } + ] + } + }, + "MetricAlertAction": { + "type": "object", + "description": "An alert action.", + "properties": { + "actionGroupId": { + "type": "string", + "description": "The id of the action group to use." + }, + "webHookProperties": { + "type": "object", + "description": "This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "MetricAlertCriteria": { + "type": "object", + "description": "The rule criteria that defines the conditions of the alert rule.", + "properties": { + "odata.type": { + "$ref": "#/definitions/Odatatype", + "description": "Specifies the type of the alert criteria. Previously undocumented values might be returned" + } + }, + "discriminator": "odata.type", + "required": [ + "odata.type" + ], + "additionalProperties": {} + }, + "MetricAlertErrorResponse": { + "type": "object", + "description": "Describes the format of Error response.", + "properties": { + "error": { + "$ref": "#/definitions/Microsoft.Common.ErrorResponseError" + } + } + }, + "MetricAlertMultipleResourceMultipleMetricCriteria": { + "type": "object", + "description": "Specifies the metric alert criteria for multiple resource that has multiple metric criteria.", + "properties": { + "allOf": { + "type": "array", + "description": "The list of multiple metric criteria for this 'all of' operation.", + "items": { + "$ref": "#/definitions/MultiMetricCriteria" + }, + "x-ms-identifiers": [ + "name" + ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/MetricAlertCriteria" + } + ], + "x-ms-discriminator-value": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" + }, + "MetricAlertProperties": { + "type": "object", + "description": "An alert rule.", + "properties": { + "description": { + "type": "string", + "description": "The description of the metric alert that will be included in the alert email." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "Alert severity {0, 1, 2, 3, 4}" + }, + "enabled": { + "type": "boolean", + "description": "The flag that indicates whether the metric alert is enabled." + }, + "scopes": { + "type": "array", + "description": "The list of resource id's that this metric alert is scoped to. You cannot change the scope of a metric rule based on logs.", + "items": { + "type": "string" + } + }, + "evaluationFrequency": { + "type": "string", + "format": "duration", + "description": "How often the metric alert is evaluated represented in ISO 8601 duration format." + }, + "windowSize": { + "type": "string", + "format": "duration", + "description": "The period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold." + }, + "targetResourceType": { + "type": "string", + "description": "The resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource." + }, + "targetResourceRegion": { + "type": "string", + "description": "The region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource." + }, + "criteria": { + "$ref": "#/definitions/MetricAlertCriteria", + "description": "Defines the specific alert criteria information." + }, + "autoMitigate": { + "type": "boolean", + "description": "The flag that indicates whether the alert should be auto resolved or not. The default is true." + }, + "resolveConfiguration": { + "$ref": "#/definitions/ResolveConfiguration", + "description": "The configuration for how the alert is resolved. Applicable for PromQLCriteria." + }, + "actions": { + "type": "array", + "description": "The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.", + "items": { + "$ref": "#/definitions/MetricAlertAction" + }, + "x-ms-identifiers": [ + "actionGroupId" + ] + }, + "lastUpdatedTime": { + "type": "string", + "format": "date-time", + "description": "Last time the rule was updated in ISO8601 format.", + "readOnly": true + }, + "isMigrated": { + "type": "boolean", + "description": "The value indicating whether this alert rule is migrated.", + "readOnly": true + }, + "customProperties": { + "type": "object", + "description": "The properties of an alert payload.", + "additionalProperties": { + "type": "string" + } + }, + "actionProperties": { + "type": "object", + "description": "The properties of an action properties.", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "severity", + "enabled", + "scopes", + "evaluationFrequency", + "criteria" + ] + }, + "MetricAlertPropertiesPatch": { + "type": "object", + "description": "An alert rule properties for patch.", + "properties": { + "description": { + "type": "string", + "description": "The description of the metric alert that will be included in the alert email." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "Alert severity {0, 1, 2, 3, 4}" + }, + "enabled": { + "type": "boolean", + "description": "The flag that indicates whether the metric alert is enabled." + }, + "scopes": { + "type": "array", + "description": "The list of resource id's that this metric alert is scoped to.", + "items": { + "type": "string" + } + }, + "evaluationFrequency": { + "type": "string", + "format": "duration", + "description": "How often the metric alert is evaluated represented in ISO 8601 duration format." + }, + "windowSize": { + "type": "string", + "format": "duration", + "description": "The period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold." + }, + "targetResourceType": { + "type": "string", + "description": "The resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria." + }, + "targetResourceRegion": { + "type": "string", + "description": "The region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria." + }, + "criteria": { + "$ref": "#/definitions/MetricAlertCriteria", + "description": "Defines the specific alert criteria information." + }, + "autoMitigate": { + "type": "boolean", + "description": "The flag that indicates whether the alert should be auto resolved or not. The default is true." + }, + "resolveConfiguration": { + "$ref": "#/definitions/ResolveConfiguration", + "description": "The configuration for how the alert is resolved. Applicable for PromQLCriteria." + }, + "actions": { + "type": "array", + "description": "The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.", + "items": { + "$ref": "#/definitions/MetricAlertAction" + }, + "x-ms-identifiers": [ + "actionGroupId" + ] + }, + "lastUpdatedTime": { + "type": "string", + "format": "date-time", + "description": "Last time the rule was updated in ISO8601 format.", + "readOnly": true + }, + "isMigrated": { + "type": "boolean", + "description": "The value indicating whether this alert rule is migrated.", + "readOnly": true + }, + "customProperties": { + "type": "object", + "description": "The properties of an alert payload.", + "additionalProperties": { + "type": "string" + } + }, + "actionProperties": { + "type": "object", + "description": "The properties of an action properties.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "MetricAlertResource": { + "type": "object", + "description": "The metric alert resource.", + "properties": { + "properties": { + "$ref": "#/definitions/MetricAlertProperties", + "description": "The alert rule properties of the resource.", + "x-ms-client-flatten": true + }, + "identity": { + "$ref": "#/definitions/Microsoft.Common.Identity", + "description": "The identity of the resource." + } + }, + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "MetricAlertResourceCollection": { + "type": "object", + "description": "Represents a collection of alert rule resources.", + "properties": { + "value": { + "type": "array", + "description": "The values for the alert rule resources.", + "items": { + "$ref": "#/definitions/MetricAlertResource" + }, + "x-ms-identifiers": [ + "id" + ] + }, + "nextLink": { + "type": "string", + "description": "The URL to get the next set of results." + } + } + }, + "MetricAlertResourcePatch": { + "type": "object", + "description": "The metric alert resource for patch operations.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags", + "additionalProperties": { + "type": "string" + } + }, + "identity": { + "$ref": "#/definitions/Microsoft.Common.Identity", + "description": "The identity of the resource." + }, + "properties": { + "$ref": "#/definitions/MetricAlertPropertiesPatch", + "description": "The alert rule properties of the resource.", + "x-ms-client-flatten": true + } + } + }, + "MetricAlertSingleResourceMultipleMetricCriteria": { + "type": "object", + "description": "Specifies the metric alert criteria for a single resource that has multiple metric criteria.", + "properties": { + "allOf": { + "type": "array", + "description": "The list of metric criteria for this 'all of' operation.", + "items": { + "$ref": "#/definitions/MetricCriteria" + }, + "x-ms-identifiers": [ + "name" + ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/MetricAlertCriteria" + } + ], + "x-ms-discriminator-value": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" + }, + "MetricAlertStatus": { + "type": "object", + "description": "An alert status.", + "properties": { + "name": { + "type": "string", + "description": "The status name." + }, + "id": { + "type": "string", + "description": "The alert rule arm id." + }, + "type": { + "type": "string", + "description": "The extended resource type name." + }, + "properties": { + "$ref": "#/definitions/MetricAlertStatusProperties", + "description": "The alert status properties of the metric alert status." + } + } + }, + "MetricAlertStatusCollection": { + "type": "object", + "description": "Represents a collection of alert rule resources.", + "properties": { + "value": { + "type": "array", + "description": "The values for the alert rule resources.", + "items": { + "$ref": "#/definitions/MetricAlertStatus" + }, + "x-ms-identifiers": [ + "id" + ] + } + } + }, + "MetricAlertStatusProperties": { + "type": "object", + "description": "An alert status properties.", + "properties": { + "dimensions": { + "type": "object", + "description": "An object describing the type of the dimensions.", + "additionalProperties": { + "type": "string" + } + }, + "status": { + "type": "string", + "description": "Status value" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "UTC time when the status was checked." + } + } + }, + "MetricCriteria": { + "type": "object", + "description": "Criterion to filter metrics.", + "properties": { + "operator": { + "$ref": "#/definitions/Operator", + "description": "The criteria operator. Previously undocumented values might be returned" + }, + "threshold": { + "type": "number", + "format": "double", + "description": "The criteria threshold value that activates the alert." + } + }, + "required": [ + "operator", + "threshold" + ], + "allOf": [ + { + "$ref": "#/definitions/MultiMetricCriteria" + } + ], + "x-ms-discriminator-value": "StaticThresholdCriterion" + }, + "MetricDimension": { + "type": "object", + "description": "Specifies a metric dimension.", + "properties": { + "name": { + "type": "string", + "description": "Name of the dimension." + }, + "operator": { + "type": "string", + "description": "The dimension operator. Only 'Include' and 'Exclude' are supported" + }, + "values": { + "type": "array", + "description": "List of dimension values.", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "Microsoft.Common.CriterionType": { + "type": "string", + "description": "Specifies the type of threshold criteria. Previously undocumented values might be returned", + "enum": [ + "StaticThresholdCriterion", + "DynamicThresholdCriterion" + ], + "x-ms-enum": { + "name": "CriterionType", + "modelAsString": true, + "values": [ + { + "name": "StaticThresholdCriterion", + "value": "StaticThresholdCriterion", + "description": "StaticThresholdCriterion" + }, + { + "name": "DynamicThresholdCriterion", + "value": "DynamicThresholdCriterion", + "description": "DynamicThresholdCriterion" + } + ] + } + }, + "Microsoft.Common.ErrorDetail": { + "type": "object", + "description": "Describes details of an error response.", + "properties": { + "code": { + "type": "string", + "description": "Unlocalized string which can be used to programmatically identify the error." + }, + "message": { + "type": "string", + "description": "Describes the error in detail and provides debugging information." + }, + "target": { + "type": "string", + "description": "The target of the particular error (for example, the name of the property in error)." + }, + "additionalInfo": { + "type": "array", + "description": "An array of objects with 'type' and 'info' properties. The schema of 'info' is service-specific and dependent on the 'type' string.", + "items": { + "$ref": "#/definitions/Microsoft.Common.ErrorDetailAdditionalInfoItem" + } + } + } + }, + "Microsoft.Common.ErrorDetailAdditionalInfoItem": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of additional information." + }, + "info": { + "type": "object", + "description": "The additional information specific to the type.", + "additionalProperties": {} + } + } + }, + "Microsoft.Common.ErrorResponseError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unlocalized string which can be used to programmatically identify the error." + }, + "message": { + "type": "string", + "description": "Describes the error in detail and provides debugging information. If Accept-Language is set in the request, it must be localized to that language." + }, + "target": { + "type": "string", + "description": "The target of the particular error (for example, the name of the property in error)." + }, + "details": { + "type": "array", + "description": "An array of additional nested error response info objects, as described by this contract.", + "items": { + "$ref": "#/definitions/Microsoft.Common.ErrorDetail" + } + }, + "additionalInfo": { + "type": "array", + "description": "An array of objects with 'type' and 'info' properties. The schema of 'info' is service-specific and dependent on the 'type' string.", + "items": { + "$ref": "#/definitions/Microsoft.Common.ErrorResponseErrorAdditionalInfoItem" + } + } + } + }, + "Microsoft.Common.ErrorResponseErrorAdditionalInfoItem": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of additional information." + }, + "info": { + "type": "object", + "description": "The additional information specific to the type.", + "additionalProperties": {} + } + } + }, + "Microsoft.Common.Identity": { + "type": "object", + "description": "Identity for the resource.", + "properties": { + "principalId": { + "type": "string", + "description": "The principal ID of resource identity.", + "readOnly": true + }, + "tenantId": { + "type": "string", + "description": "The tenant ID of resource.", + "readOnly": true + }, + "type": { + "$ref": "#/definitions/Microsoft.Common.IdentityType", + "description": "Type of managed service identity." + }, + "userAssignedIdentities": { + "type": "object", + "description": "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + "additionalProperties": { + "$ref": "#/definitions/Microsoft.Common.UserIdentityProperties" + } + } + }, + "required": [ + "type" + ] + }, + "Microsoft.Common.IdentityType": { + "type": "string", + "description": "Type of managed service identity.", + "enum": [ + "SystemAssigned", + "UserAssigned", + "None" + ], + "x-ms-enum": { + "name": "IdentityType", + "modelAsString": false, + "values": [ + { + "name": "SystemAssigned", + "value": "SystemAssigned", + "description": "SystemAssigned" + }, + { + "name": "UserAssigned", + "value": "UserAssigned", + "description": "UserAssigned" + }, + { + "name": "None", + "value": "None", + "description": "None" + } + ] + } + }, + "Microsoft.Common.UserIdentityProperties": { + "type": "object", + "description": "Properties of the user assigned identity.", + "properties": { + "principalId": { + "type": "string", + "description": "The principal ID of resource identity.", + "readOnly": true + }, + "clientId": { + "type": "string", + "description": "The client ID of resource identity.", + "readOnly": true + } + } + }, + "MultiMetricCriteria": { + "type": "object", + "description": "The types of conditions for a multi resource alert.", + "properties": { + "criterionType": { + "$ref": "#/definitions/Microsoft.Common.CriterionType", + "description": "Specifies the type of threshold criteria. Previously undocumented values might be returned" + }, + "name": { + "type": "string", + "description": "Name of the criteria." + }, + "metricName": { + "type": "string", + "description": "Name of the metric." + }, + "metricNamespace": { + "type": "string", + "description": "Namespace of the metric." + }, + "timeAggregation": { + "$ref": "#/definitions/AggregationTypeEnum", + "description": "The criteria time aggregation types. Previously undocumented values might be returned" + }, + "dimensions": { + "type": "array", + "description": "List of dimension conditions.", + "items": { + "$ref": "#/definitions/MetricDimension" + }, + "x-ms-identifiers": [ + "name" + ] + }, + "skipMetricValidation": { + "type": "boolean", + "description": "Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped." + } + }, + "discriminator": "criterionType", + "required": [ + "criterionType", + "name", + "metricName", + "timeAggregation" + ], + "additionalProperties": {} + }, + "MultiPromQLCriteria": { + "type": "object", + "description": "The types of conditions for a multi query metric alert.", + "properties": { + "criterionType": { + "$ref": "#/definitions/Microsoft.Common.CriterionType", + "description": "Specifies the type of threshold criteria. Previously undocumented values might be returned" + }, + "name": { + "type": "string", + "description": "Name of the criteria." + }, + "query": { + "type": "string", + "description": "The query used to evaluate the alert rule" + } + }, + "discriminator": "criterionType", + "required": [ + "criterionType", + "name", + "query" + ] + }, + "Odatatype": { + "type": "string", + "description": "Specifies the type of the alert criteria. Previously undocumented values might be returned", + "enum": [ + "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", + "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", + "Microsoft.Azure.Monitor.PromQLCriteria" + ], + "x-ms-enum": { + "name": "Odatatype", + "modelAsString": true, + "values": [ + { + "name": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "value": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "description": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" + }, + { + "name": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", + "value": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", + "description": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" + }, + { + "name": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", + "value": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", + "description": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" + }, + { + "name": "Microsoft.Azure.Monitor.PromQLCriteria", + "value": "Microsoft.Azure.Monitor.PromQLCriteria", + "description": "Microsoft.Azure.Monitor.PromQLCriteria" + } + ] + } + }, + "Operator": { + "type": "string", + "description": "The criteria operator. Previously undocumented values might be returned", + "enum": [ + "Equals", + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ], + "x-ms-enum": { + "name": "Operator", + "modelAsString": true, + "values": [ + { + "name": "Equals", + "value": "Equals", + "description": "Equals" + }, + { + "name": "GreaterThan", + "value": "GreaterThan", + "description": "GreaterThan" + }, + { + "name": "GreaterThanOrEqual", + "value": "GreaterThanOrEqual", + "description": "GreaterThanOrEqual" + }, + { + "name": "LessThan", + "value": "LessThan", + "description": "LessThan" + }, + { + "name": "LessThanOrEqual", + "value": "LessThanOrEqual", + "description": "LessThanOrEqual" + } + ] + } + }, + "PromQLCriteria": { + "type": "object", + "description": "Specifies the PromQL criteria for the metric alert resource.", + "properties": { + "failingPeriods": { + "$ref": "#/definitions/QueryFailingPeriods", + "description": "Configuration for failing periods in query-based alerts." + }, + "allOf": { + "type": "array", + "description": "The list of promQL criteria. Alert will be raised when all conditions are met.", + "items": { + "$ref": "#/definitions/MultiPromQLCriteria" + }, + "x-ms-identifiers": [ + "name" + ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/MetricAlertCriteria" + } + ], + "x-ms-discriminator-value": "Microsoft.Azure.Monitor.PromQLCriteria" + }, + "QueryFailingPeriods": { + "type": "object", + "description": "Configuration for failing periods in query-based alerts.", + "properties": { + "for": { + "type": "string", + "format": "duration", + "description": "The amount of time (in ISO 8601 duration format) alert must be active before firing." + } + }, + "required": [ + "for" + ] + }, + "ResolveConfiguration": { + "type": "object", + "properties": { + "autoResolved": { + "type": "boolean", + "description": "Indicates whether the alert should be auto resolved" + }, + "timeToResolve": { + "type": "string", + "format": "duration", + "description": "The time (in ISO 8601 duration format) after which the alert should be auto resolved" + } + }, + "required": [ + "autoResolved" + ] + }, + "StaticPromQLCriteria": { + "type": "object", + "description": "The criterion for static prom query.", + "allOf": [ + { + "$ref": "#/definitions/MultiPromQLCriteria" + } + ], + "x-ms-discriminator-value": "StaticThresholdCriterion" + }, + "WebtestLocationAvailabilityCriteria": { + "type": "object", + "description": "Specifies the metric alert rule criteria for a web test resource.", + "properties": { + "webTestId": { + "type": "string", + "description": "The Application Insights web test Id." + }, + "componentId": { + "type": "string", + "description": "The Application Insights resource Id." + }, + "failedLocationCount": { + "type": "number", + "format": "float", + "description": "The number of failed locations." + } + }, + "required": [ + "webTestId", + "componentId", + "failedLocationCount" + ], + "allOf": [ + { + "$ref": "#/definitions/MetricAlertCriteria" + } + ], + "x-ms-discriminator-value": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" + } + }, + "parameters": {} +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/readme.md b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/readme.md new file mode 100644 index 000000000000..d51552a52b2e --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/Insights/stable/2026-01-01/readme.md @@ -0,0 +1,23 @@ +# Monitor Insights 2026-01-01 + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Monitor Insights stable API version 2026-01-01. + +## Configuration + +```yaml +description: Monitor Insights Client (2026-01-01) +openapi-type: arm +tag: package-2026-01-01 +``` + +### Tag: package-2026-01-01 + +These settings apply only when `--tag=package-2026-01-01` is specified on the command line. + +```yaml $(tag) == 'package-2026-01-01' +input-file: + - activityLogAlerts_API.json + - metricAlert.json +```