Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6556222
Add Metric Alerts Query GA 2026-06-01 swagger [metric-alerts-query-ga…
sidanmor May 28, 2026
ca25608
Address ARM API review suggestions [metric-alerts-query-ga-swagger]
sidanmor Jun 2, 2026
e339d9e
Apply PR decisions for package tag and error model [metric-alerts-que…
sidanmor Jun 2, 2026
f6ad53c
Fix metric alert GA api-version to 2026-01-01
sidanmor Jun 3, 2026
e25710a
Regenerate MetricAlert swagger outputs for TypeSpec validation
Copilot Jun 14, 2026
2fcca45
Merge branch 'Azure:main' into metric-alerts-query-ga-swagger-stream1-v2
sidanmor Jun 14, 2026
ea04f8e
Merge pull request #1 from Azure/copilot/fix-typespec-validation
sidanmor Jun 14, 2026
14216b0
Initial plan
Copilot Jun 14, 2026
562b137
Fix TypeSpec formatting in MetricAlertResource.tsp
Copilot Jun 14, 2026
0d85bef
Merge branch 'metric-alerts-query-ga-swagger-stream1-v2' into copilot…
sidanmor Jun 14, 2026
72a57ac
Merge pull request #2 from Azure/copilot/fix-typespec-validation-job-…
sidanmor Jun 14, 2026
655bd3a
Format ArmResourceRead method signature for better readability
sidanmor Jun 16, 2026
05ae3b1
Remove trailing whitespace from Metric Alert API example JSON files
sidanmor Jun 16, 2026
8200221
Enhance metric alert examples with detailed properties and criteria
sidanmor Jun 16, 2026
6ebcacd
Remove trailing whitespace from multiple Metric Alert API example JSO…
sidanmor Jun 16, 2026
4dcbe5a
Revert preview swagger 2024-03-01-preview to fix LintDiff breaking ch…
sidanmor Jun 16, 2026
43b11bf
Update error response references and descriptions in metricAlert.json
sidanmor Jun 16, 2026
9e33331
Update tag in readme.md to package-2026-01-01 and suppress example va…
sidanmor Jun 16, 2026
e544ddc
Update tag in readme.md to package-2025-08 and adjust input file path…
sidanmor Jun 16, 2026
6cb83a9
Enhance metricAlert.json: Add pagination support and improve descript…
sidanmor Jun 17, 2026
8ad03e2
Refactor metricAlert.json: Simplify descriptions for aggregation, ope…
sidanmor Jun 21, 2026
45d2062
Add examples for creating/updating metric alerts with various configu…
sidanmor Jun 21, 2026
cf8e9e8
Update metric alert example files from TypeSpec compilation
sidanmor Jun 21, 2026
99106fe
Initial plan
Copilot Jun 21, 2026
0ba7f30
Add GA stable/2026-01-01/metricAlert.json swagger, examples, and sing…
Copilot Jun 21, 2026
c89fe09
Fix review issues: update Azure AD wording to Microsoft Entra ID, fix…
Copilot Jun 21, 2026
8640d95
Add format: uri to nextLink property in metricAlert.json
Copilot Jun 21, 2026
569eade
Merge branch 'Azure:main' into metric-alerts-query-ga-swagger-stream1-v2
sidanmor Jun 21, 2026
8b98a68
Merge branch 'metric-alerts-query-ga-swagger-stream1-v2' into copilot…
sidanmor Jun 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,29 @@ interface MetricAlertResources {
* Retrieve an alert rule definition.
*/
@tag("MetricAlerts")
get is ArmResourceRead<MetricAlertResource, Error = MetricAlertErrorResponse>;
get is ArmResourceRead<
MetricAlertResource,
Error = Microsoft.Common.ErrorResponse
>;

/**
* 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<MetricAlertResource>,
Error = MetricAlertErrorResponse
Error = Microsoft.Common.ErrorResponse
>;

/**
* Update an metric alert definition.
* Update a metric alert definition.
*/
@patch(#{ implicitOptionality: false })
@tag("MetricAlerts")
update is ArmCustomPatchSync<
MetricAlertResource,
PatchModel = MetricAlertResourcePatch,
Error = MetricAlertErrorResponse
Error = Microsoft.Common.ErrorResponse
>;

/**
Expand All @@ -96,7 +97,7 @@ interface MetricAlertResources {
@tag("MetricAlerts")
delete is ArmResourceDeleteSync<
MetricAlertResource,
Error = MetricAlertErrorResponse
Error = Microsoft.Common.ErrorResponse
>;

/**
Expand All @@ -106,7 +107,7 @@ interface MetricAlertResources {
listByResourceGroup is ArmResourceListByParent<
MetricAlertResource,
Response = ArmResponse<MetricAlertResourceCollection>,
Error = MetricAlertErrorResponse
Error = Microsoft.Common.ErrorResponse
>;

/**
Expand All @@ -116,7 +117,7 @@ interface MetricAlertResources {
listBySubscription is ArmListBySubscription<
MetricAlertResource,
Response = ArmResponse<MetricAlertResourceCollection>,
Error = MetricAlertErrorResponse
Error = Microsoft.Common.ErrorResponse
>;

/**
Expand All @@ -136,7 +137,7 @@ interface MetricAlertResources {
@segment("metricAlerts")
ruleName: string;
},
Error = MetricAlertErrorResponse
Error = Microsoft.Common.ErrorResponse
>;

/**
Expand All @@ -155,7 +156,7 @@ interface MetricAlertResources {
@segment("status")
statusName: string;
},
OverrideErrorType = MetricAlertErrorResponse
OverrideErrorType = Microsoft.Common.ErrorResponse
>;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -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"
}
Loading