diff --git a/src/azure-cli/azure/cli/command_modules/monitor/operations/metric_alert.py b/src/azure-cli/azure/cli/command_modules/monitor/operations/metric_alert.py index bd5d2da4253..4502a093524 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/operations/metric_alert.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/operations/metric_alert.py @@ -88,14 +88,9 @@ def update_metric_alert(instance, scopes=None, description=None, enabled=None, t # process action additions if add_actions is not None: - for action in add_actions: - match = next( - (x for x in instance.actions if action.action_group_id.lower() == x.action_group_id.lower()), None - ) - if match: - match.webhook_properties = action.webhook_properties - else: - instance.actions.append(action) + add_action_ids = {x.action_group_id.lower() for x in add_actions} + instance.actions = [x for x in instance.actions if x.action_group_id.lower() not in add_action_ids] + instance.actions.extend(add_actions) # process condition removals if remove_conditions is not None: diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_v2_scenario.yaml b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_v2_scenario.yaml index 6f72cfc77c6..10efc14f1c4 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_v2_scenario.yaml +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_v2_scenario.yaml @@ -21,7 +21,7 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1?api-version=2019-06-01 response: @@ -35,7 +35,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:11 GMT + - Fri, 12 Mar 2021 03:59:26 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1199' status: code: 201 message: Created @@ -73,7 +73,7 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2?api-version=2019-06-01 response: @@ -87,7 +87,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:17 GMT + - Fri, 12 Mar 2021 03:59:31 GMT expires: - '-1' pragma: @@ -99,7 +99,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 201 message: Created @@ -132,7 +132,7 @@ interactions: ParameterSetName: - -g -n --scopes --action --region --description --condition --condition User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -144,27 +144,24 @@ interactions: [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT1M\",\r\n \"windowSize\": \"PT5M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 5.0,\r\n \"name\": \"cond0\",\r\n \"metricNamespace\": \"microsoft.storage/storageaccounts\",\r\n - \ \"metricName\": \"transactions\",\r\n \"dimensions\": [\r\n - \ {\r\n \"name\": \"ResponseType\",\r\n \"operator\": - \"Include\",\r\n \"values\": [\r\n \"Success\"\r\n - \ ]\r\n },\r\n {\r\n \"name\": - \"ApiName\",\r\n \"operator\": \"Include\",\r\n \"values\": - [\r\n \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n + 5.0,\r\n \"name\": \"cond0\",\r\n \"metricName\": \"transactions\",\r\n + \ \"dimensions\": [\r\n {\r\n \"name\": \"ResponseType\",\r\n + \ \"operator\": \"Include\",\r\n \"values\": [\r\n + \ \"Success\"\r\n ]\r\n },\r\n {\r\n + \ \"name\": \"ApiName\",\r\n \"operator\": \"Include\",\r\n + \ \"values\": [\r\n \"GetBlob\"\r\n ]\r\n + \ }\r\n ],\r\n \"operator\": \"GreaterThan\",\r\n + \ \"timeAggregation\": \"Total\",\r\n \"criterionType\": + \"StaticThresholdCriterion\"\r\n },\r\n {\r\n \"threshold\": + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n + \ \"operator\": \"Include\",\r\n \"values\": [\r\n + \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": - \"Total\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n - \ },\r\n {\r\n \"threshold\": 250.0,\r\n \"name\": - \"cond1\",\r\n \"metricNamespace\": \"microsoft.storage/storageaccounts\",\r\n - \ \"metricName\": \"SuccessE2ELatency\",\r\n \"dimensions\": - [\r\n {\r\n \"name\": \"ApiName\",\r\n \"operator\": - \"Include\",\r\n \"values\": [\r\n \"GetBlob\"\r\n - \ ]\r\n }\r\n ],\r\n \"operator\": - \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": - \"StaticThresholdCriterion\"\r\n }\r\n ],\r\n \"odata.type\": - \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n },\r\n - \ \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n \"targetResourceRegion\": - \"westus\",\r\n \"actions\": [\r\n {\r\n \"actionGroupId\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n + \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n + \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n + \ },\r\n \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n + \ {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n \ }\r\n ]\r\n }\r\n}" headers: api-supported-versions: @@ -172,11 +169,11 @@ interactions: cache-control: - no-cache content-length: - - '2460' + - '2262' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:31 GMT + - Fri, 12 Mar 2021 03:59:44 GMT expires: - '-1' pragma: @@ -215,7 +212,7 @@ interactions: - -g -n --severity --description --add-action --remove-action --remove-conditions --evaluation-frequency --window-size --tags --auto-mitigate User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -227,27 +224,24 @@ interactions: [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT1M\",\r\n \"windowSize\": \"PT5M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 5.0,\r\n \"name\": \"cond0\",\r\n \"metricNamespace\": \"microsoft.storage/storageaccounts\",\r\n - \ \"metricName\": \"transactions\",\r\n \"dimensions\": [\r\n - \ {\r\n \"name\": \"ResponseType\",\r\n \"operator\": - \"Include\",\r\n \"values\": [\r\n \"Success\"\r\n - \ ]\r\n },\r\n {\r\n \"name\": - \"ApiName\",\r\n \"operator\": \"Include\",\r\n \"values\": - [\r\n \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n + 5.0,\r\n \"name\": \"cond0\",\r\n \"metricName\": \"transactions\",\r\n + \ \"dimensions\": [\r\n {\r\n \"name\": \"ResponseType\",\r\n + \ \"operator\": \"Include\",\r\n \"values\": [\r\n + \ \"Success\"\r\n ]\r\n },\r\n {\r\n + \ \"name\": \"ApiName\",\r\n \"operator\": \"Include\",\r\n + \ \"values\": [\r\n \"GetBlob\"\r\n ]\r\n + \ }\r\n ],\r\n \"operator\": \"GreaterThan\",\r\n + \ \"timeAggregation\": \"Total\",\r\n \"criterionType\": + \"StaticThresholdCriterion\"\r\n },\r\n {\r\n \"threshold\": + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n + \ \"operator\": \"Include\",\r\n \"values\": [\r\n + \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": - \"Total\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n - \ },\r\n {\r\n \"threshold\": 250.0,\r\n \"name\": - \"cond1\",\r\n \"metricNamespace\": \"microsoft.storage/storageaccounts\",\r\n - \ \"metricName\": \"SuccessE2ELatency\",\r\n \"dimensions\": - [\r\n {\r\n \"name\": \"ApiName\",\r\n \"operator\": - \"Include\",\r\n \"values\": [\r\n \"GetBlob\"\r\n - \ ]\r\n }\r\n ],\r\n \"operator\": - \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": - \"StaticThresholdCriterion\"\r\n }\r\n ],\r\n \"odata.type\": - \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n },\r\n - \ \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n \"targetResourceRegion\": - \"westus\",\r\n \"actions\": [\r\n {\r\n \"actionGroupId\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n + \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n + \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n + \ },\r\n \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n + \ {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n \ }\r\n ]\r\n }\r\n}" headers: api-supported-versions: @@ -255,11 +249,11 @@ interactions: cache-control: - no-cache content-length: - - '2460' + - '2262' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:32 GMT + - Fri, 12 Mar 2021 03:59:45 GMT expires: - '-1' pragma: @@ -284,13 +278,11 @@ interactions: - request: body: '{"location": "global", "tags": {"foo": "boo"}, "properties": {"description": "alt desc", "severity": 3, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002"], - "evaluationFrequency": "PT5M", "windowSize": "PT15M", "targetResourceType": - "microsoft.storage/storageaccounts", "targetResourceRegion": "westus", "criteria": - {"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "evaluationFrequency": "PT5M", "windowSize": "PT15M", "targetResourceRegion": + "westus", "criteria": {"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", "allOf": [{"criterionType": "StaticThresholdCriterion", "name": "cond1", "metricName": - "SuccessE2ELatency", "metricNamespace": "microsoft.storage/storageaccounts", - "timeAggregation": "Average", "dimensions": [{"name": "ApiName", "operator": - "Include", "values": ["GetBlob"]}], "operator": "GreaterThan", "threshold": + "SuccessE2ELatency", "timeAggregation": "Average", "dimensions": [{"name": "ApiName", + "operator": "Include", "values": ["GetBlob"]}], "operator": "GreaterThan", "threshold": 250.0}]}, "autoMitigate": true, "actions": [{"actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2", "webHookProperties": {"test": "best"}}]}}' headers: @@ -303,14 +295,14 @@ interactions: Connection: - keep-alive Content-Length: - - '1198' + - '1083' Content-Type: - application/json ParameterSetName: - -g -n --severity --description --add-action --remove-action --remove-conditions --evaluation-frequency --window-size --tags --auto-mitigate User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -322,17 +314,15 @@ interactions: 3,\r\n \"enabled\": true,\r\n \"scopes\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT5M\",\r\n \"windowSize\": \"PT15M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 250.0,\r\n \"name\": \"cond1\",\r\n \"metricNamespace\": - \"microsoft.storage/storageaccounts\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n \ \"operator\": \"Include\",\r\n \"values\": [\r\n \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n - \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n - \ \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n {\r\n - \ \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n + \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceRegion\": \"westus\",\r\n + \ \"actions\": [\r\n {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n \ \"webHookProperties\": {\r\n \"test\": \"best\"\r\n }\r\n \ }\r\n ]\r\n }\r\n}" headers: @@ -341,11 +331,11 @@ interactions: cache-control: - no-cache content-length: - - '1886' + - '1755' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:47 GMT + - Fri, 12 Mar 2021 03:59:56 GMT expires: - '-1' pragma: @@ -363,7 +353,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '298' + - '297' x-powered-by: - ASP.NET status: @@ -383,7 +373,7 @@ interactions: ParameterSetName: - -g -n --enabled User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -395,17 +385,15 @@ interactions: 3,\r\n \"enabled\": true,\r\n \"scopes\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT5M\",\r\n \"windowSize\": \"PT15M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 250.0,\r\n \"name\": \"cond1\",\r\n \"metricNamespace\": - \"microsoft.storage/storageaccounts\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n \ \"operator\": \"Include\",\r\n \"values\": [\r\n \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n - \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n - \ \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n {\r\n - \ \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n + \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceRegion\": \"westus\",\r\n + \ \"actions\": [\r\n {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n \ \"webHookProperties\": {\r\n \"test\": \"best\"\r\n }\r\n \ }\r\n ]\r\n }\r\n}" headers: @@ -414,11 +402,11 @@ interactions: cache-control: - no-cache content-length: - - '1886' + - '1755' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:47 GMT + - Fri, 12 Mar 2021 03:59:57 GMT expires: - '-1' pragma: @@ -443,13 +431,11 @@ interactions: - request: body: '{"location": "global", "tags": {"foo": "boo"}, "properties": {"description": "alt desc", "severity": 3, "enabled": false, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002"], - "evaluationFrequency": "PT5M", "windowSize": "PT15M", "targetResourceType": - "microsoft.storage/storageaccounts", "targetResourceRegion": "westus", "criteria": - {"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "evaluationFrequency": "PT5M", "windowSize": "PT15M", "targetResourceRegion": + "westus", "criteria": {"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", "allOf": [{"criterionType": "StaticThresholdCriterion", "name": "cond1", "metricName": - "SuccessE2ELatency", "metricNamespace": "microsoft.storage/storageaccounts", - "timeAggregation": "Average", "dimensions": [{"name": "ApiName", "operator": - "Include", "values": ["GetBlob"]}], "operator": "GreaterThan", "threshold": + "SuccessE2ELatency", "timeAggregation": "Average", "dimensions": [{"name": "ApiName", + "operator": "Include", "values": ["GetBlob"]}], "operator": "GreaterThan", "threshold": 250.0}]}, "autoMitigate": true, "actions": [{"actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2", "webHookProperties": {"test": "best"}}]}}' headers: @@ -462,13 +448,13 @@ interactions: Connection: - keep-alive Content-Length: - - '1199' + - '1084' Content-Type: - application/json ParameterSetName: - -g -n --enabled User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -480,17 +466,15 @@ interactions: 3,\r\n \"enabled\": false,\r\n \"scopes\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT5M\",\r\n \"windowSize\": \"PT15M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 250.0,\r\n \"name\": \"cond1\",\r\n \"metricNamespace\": - \"microsoft.storage/storageaccounts\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n \ \"operator\": \"Include\",\r\n \"values\": [\r\n \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n - \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n - \ \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n {\r\n - \ \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n + \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceRegion\": \"westus\",\r\n + \ \"actions\": [\r\n {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n \ \"webHookProperties\": {\r\n \"test\": \"best\"\r\n }\r\n \ }\r\n ]\r\n }\r\n}" headers: @@ -499,11 +483,11 @@ interactions: cache-control: - no-cache content-length: - - '1887' + - '1756' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:54 GMT + - Fri, 12 Mar 2021 04:00:01 GMT expires: - '-1' pragma: @@ -521,7 +505,159 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '297' + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor metrics alert update + Connection: + - keep-alive + ParameterSetName: + - -g -n --add-action + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 + response: + body: + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1\",\r\n + \ \"name\": \"alert1\",\r\n \"type\": \"Microsoft.Insights/metricAlerts\",\r\n + \ \"location\": \"global\",\r\n \"tags\": {\r\n \"foo\": \"boo\"\r\n },\r\n + \ \"properties\": {\r\n \"description\": \"alt desc\",\r\n \"severity\": + 3,\r\n \"enabled\": false,\r\n \"scopes\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n + \ ],\r\n \"evaluationFrequency\": \"PT5M\",\r\n \"windowSize\": \"PT15M\",\r\n + \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n + \ \"operator\": \"Include\",\r\n \"values\": [\r\n + \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n + \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": + \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n + \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n + \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceRegion\": \"westus\",\r\n + \ \"actions\": [\r\n {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n + \ \"webHookProperties\": {\r\n \"test\": \"best\"\r\n }\r\n + \ }\r\n ]\r\n }\r\n}" + headers: + api-supported-versions: + - 1.0, 2.0, 2017-09-01-preview, 2018-03-01 + cache-control: + - no-cache + content-length: + - '1756' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 12 Mar 2021 04:00:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "global", "tags": {"foo": "boo"}, "properties": {"description": + "alt desc", "severity": 3, "enabled": false, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002"], + "evaluationFrequency": "PT5M", "windowSize": "PT15M", "targetResourceRegion": + "westus", "criteria": {"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [{"criterionType": "StaticThresholdCriterion", "name": "cond1", "metricName": + "SuccessE2ELatency", "timeAggregation": "Average", "dimensions": [{"name": "ApiName", + "operator": "Include", "values": ["GetBlob"]}], "operator": "GreaterThan", "threshold": + 250.0}]}, "autoMitigate": true, "actions": [{"actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2", + "webHookProperties": {"test": "best2"}}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor metrics alert update + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/json + ParameterSetName: + - -g -n --add-action + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 + response: + body: + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1\",\r\n + \ \"name\": \"alert1\",\r\n \"type\": \"Microsoft.Insights/metricAlerts\",\r\n + \ \"location\": \"global\",\r\n \"tags\": {\r\n \"foo\": \"boo\"\r\n },\r\n + \ \"properties\": {\r\n \"description\": \"alt desc\",\r\n \"severity\": + 3,\r\n \"enabled\": false,\r\n \"scopes\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n + \ ],\r\n \"evaluationFrequency\": \"PT5M\",\r\n \"windowSize\": \"PT15M\",\r\n + \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n + \ \"operator\": \"Include\",\r\n \"values\": [\r\n + \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n + \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": + \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n + \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n + \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceRegion\": \"westus\",\r\n + \ \"actions\": [\r\n {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n + \ \"webHookProperties\": {\r\n \"test\": \"best2\"\r\n }\r\n + \ }\r\n ]\r\n }\r\n}" + headers: + api-supported-versions: + - 1.0, 2.0, 2017-09-01-preview, 2018-03-01 + cache-control: + - no-cache + content-length: + - '1757' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 12 Mar 2021 04:00:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' x-powered-by: - ASP.NET status: @@ -541,7 +677,7 @@ interactions: ParameterSetName: - -g User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts?api-version=2018-03-01 response: @@ -555,7 +691,6 @@ interactions: \ ],\r\n \"evaluationFrequency\": \"PT5M\",\r\n \"windowSize\": \"PT15M\",\r\n \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \ \"threshold\": 250.0,\r\n \"name\": \"cond1\",\r\n - \ \"metricNamespace\": \"microsoft.storage/storageaccounts\",\r\n \ \"metricName\": \"SuccessE2ELatency\",\r\n \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n \"operator\": \"Include\",\r\n \"values\": [\r\n \"GetBlob\"\r\n @@ -563,10 +698,9 @@ interactions: \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n },\r\n - \ \"autoMitigate\": true,\r\n \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n - \ \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n - \ {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n - \ \"webHookProperties\": {\r\n \"test\": \"best\"\r\n + \ \"autoMitigate\": true,\r\n \"targetResourceRegion\": \"westus\",\r\n + \ \"actions\": [\r\n {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n + \ \"webHookProperties\": {\r\n \"test\": \"best2\"\r\n \ }\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}" headers: api-supported-versions: @@ -574,11 +708,11 @@ interactions: cache-control: - no-cache content-length: - - '2124' + - '1986' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:55 GMT + - Fri, 12 Mar 2021 04:00:05 GMT expires: - '-1' pragma: @@ -614,7 +748,7 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -626,18 +760,16 @@ interactions: 3,\r\n \"enabled\": false,\r\n \"scopes\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT5M\",\r\n \"windowSize\": \"PT15M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 250.0,\r\n \"name\": \"cond1\",\r\n \"metricNamespace\": - \"microsoft.storage/storageaccounts\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + 250.0,\r\n \"name\": \"cond1\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n \ \"operator\": \"Include\",\r\n \"values\": [\r\n \ \"GetBlob\"\r\n ]\r\n }\r\n ],\r\n \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n - \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n - \ \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n {\r\n - \ \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n - \ \"webHookProperties\": {\r\n \"test\": \"best\"\r\n }\r\n + \ },\r\n \"autoMitigate\": true,\r\n \"targetResourceRegion\": \"westus\",\r\n + \ \"actions\": [\r\n {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag2\",\r\n + \ \"webHookProperties\": {\r\n \"test\": \"best2\"\r\n }\r\n \ }\r\n ]\r\n }\r\n}" headers: api-supported-versions: @@ -645,11 +777,11 @@ interactions: cache-control: - no-cache content-length: - - '1887' + - '1757' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:57:55 GMT + - Fri, 12 Mar 2021 04:00:06 GMT expires: - '-1' pragma: @@ -687,7 +819,7 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -701,7 +833,7 @@ interactions: content-length: - '0' date: - - Mon, 01 Feb 2021 07:58:00 GMT + - Fri, 12 Mar 2021 04:00:11 GMT expires: - '-1' pragma: @@ -715,7 +847,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' x-powered-by: - ASP.NET status: @@ -735,7 +867,7 @@ interactions: ParameterSetName: - -g User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts?api-version=2018-03-01 response: @@ -751,7 +883,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:58:01 GMT + - Fri, 12 Mar 2021 04:00:11 GMT expires: - '-1' pragma: @@ -798,7 +930,7 @@ interactions: ParameterSetName: - -g -n --scopes --region --action --description --condition User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert1?api-version=2018-03-01 response: @@ -810,17 +942,15 @@ interactions: [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Storage/storageAccounts/clitest000002\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT1M\",\r\n \"windowSize\": \"PT5M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 250.0,\r\n \"name\": \"cond0\",\r\n \"metricNamespace\": - \"microsoft.storage/storageaccounts\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n + 250.0,\r\n \"name\": \"cond0\",\r\n \"metricName\": \"SuccessE2ELatency\",\r\n \ \"dimensions\": [\r\n {\r\n \"name\": \"ApiName\",\r\n \ \"operator\": \"Include\",\r\n \"values\": [\r\n \ \"GetBlob:\"\r\n ]\r\n }\r\n ],\r\n \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": \"Average\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n - \ },\r\n \"targetResourceType\": \"microsoft.storage/storageaccounts\",\r\n - \ \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n {\r\n - \ \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n + \ },\r\n \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n + \ {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n \ }\r\n ]\r\n }\r\n}" headers: api-supported-versions: @@ -828,11 +958,11 @@ interactions: cache-control: - no-cache content-length: - - '1749' + - '1618' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:58:13 GMT + - Fri, 12 Mar 2021 04:00:21 GMT expires: - '-1' pragma: @@ -850,7 +980,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '296' + - '298' x-powered-by: - ASP.NET status: @@ -870,15 +1000,15 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_metric_alert_v2000001?api-version=2020-10-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001","name":"cli_test_metric_alert_v2000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-02-01T07:56:35Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001","name":"cli_test_metric_alert_v2000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-03-12T03:58:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -887,7 +1017,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:58:16 GMT + - Fri, 12 Mar 2021 04:00:22 GMT expires: - '-1' pragma: @@ -920,8 +1050,8 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: POST @@ -937,7 +1067,7 @@ interactions: content-type: - application/json date: - - Mon, 01 Feb 2021 07:58:18 GMT + - Fri, 12 Mar 2021 04:00:23 GMT expires: - '-1' pragma: @@ -975,15 +1105,15 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_metric_alert_v2000001?api-version=2020-10-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001","name":"cli_test_metric_alert_v2000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-02-01T07:56:35Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001","name":"cli_test_metric_alert_v2000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-03-12T03:58:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -992,7 +1122,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:58:18 GMT + - Fri, 12 Mar 2021 04:00:23 GMT expires: - '-1' pragma: @@ -1025,27 +1155,27 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/serverfarms/plan1?api-version=2019-08-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/serverfarms/plan1","name":"plan1","type":"Microsoft.Web/serverfarms","kind":"app","location":"westus","properties":{"serverFarmId":49825,"name":"plan1","sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1},"workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"cli_test_metric_alert_v2000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-141_49825","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/serverfarms/plan1","name":"plan1","type":"Microsoft.Web/serverfarms","kind":"app","location":"westus","properties":{"serverFarmId":40095,"name":"plan1","sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1},"workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"cli_test_metric_alert_v2000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-095_40095","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"kubeEnvironmentProfile":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1559' + - '1589' content-type: - application/json date: - - Mon, 01 Feb 2021 07:58:31 GMT + - Fri, 12 Mar 2021 04:00:34 GMT etag: - - '"1D6F87007883180"' + - '"1D716F43FB65EAB"' expires: - '-1' pragma: @@ -1063,7 +1193,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' x-powered-by: - ASP.NET status: @@ -1083,8 +1213,8 @@ interactions: ParameterSetName: - -g -n -p User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: GET @@ -1092,17 +1222,17 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/serverfarms/plan1","name":"plan1","type":"Microsoft.Web/serverfarms","kind":"app","location":"West - US","properties":{"serverFarmId":49825,"name":"plan1","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"cli_test_metric_alert_v2000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-141_49825","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' + US","properties":{"serverFarmId":40095,"name":"plan1","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"cli_test_metric_alert_v2000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-095_40095","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"kubeEnvironmentProfile":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1487' + - '1517' content-type: - application/json date: - - Mon, 01 Feb 2021 07:58:32 GMT + - Fri, 12 Mar 2021 04:00:37 GMT expires: - '-1' pragma: @@ -1143,8 +1273,8 @@ interactions: ParameterSetName: - -g -n -p User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: POST @@ -1160,7 +1290,7 @@ interactions: content-type: - application/json date: - - Mon, 01 Feb 2021 07:58:33 GMT + - Fri, 12 Mar 2021 04:00:37 GMT expires: - '-1' pragma: @@ -1178,7 +1308,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -1198,8 +1328,8 @@ interactions: ParameterSetName: - -g -n -p User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: GET @@ -1207,17 +1337,17 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/serverfarms/plan1","name":"plan1","type":"Microsoft.Web/serverfarms","kind":"app","location":"West - US","properties":{"serverFarmId":49825,"name":"plan1","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"cli_test_metric_alert_v2000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-141_49825","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' + US","properties":{"serverFarmId":40095,"name":"plan1","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"cli_test_metric_alert_v2000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-095_40095","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"kubeEnvironmentProfile":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1487' + - '1517' content-type: - application/json date: - - Mon, 01 Feb 2021 07:58:34 GMT + - Fri, 12 Mar 2021 04:00:39 GMT expires: - '-1' pragma: @@ -1257,8 +1387,8 @@ interactions: ParameterSetName: - -g -n -p User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: POST @@ -1274,7 +1404,7 @@ interactions: content-type: - application/json date: - - Mon, 01 Feb 2021 07:58:36 GMT + - Fri, 12 Mar 2021 04:00:40 GMT expires: - '-1' pragma: @@ -1318,8 +1448,8 @@ interactions: ParameterSetName: - -g -n -p User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: PUT @@ -1327,20 +1457,20 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/sites/app000003","name":"app000003","type":"Microsoft.Web/sites","kind":"app","location":"West - US","properties":{"name":"app000003","state":"Running","hostNames":["app000003.azurewebsites.net"],"webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","selfLink":"https://waws-prod-bay-141.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/cli_test_metric_alert_v2000001-WestUSwebspace/sites/app000003","repositorySiteName":"app000003","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["app000003.azurewebsites.net","app000003.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"app000003.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"app000003.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/serverfarms/plan1","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-01T07:58:42.6966667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"name":"app000003","state":"Running","hostNames":["app000003.azurewebsites.net"],"webSpace":"cli_test_metric_alert_v2000001-WestUSwebspace","selfLink":"https://waws-prod-bay-095.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/cli_test_metric_alert_v2000001-WestUSwebspace/sites/app000003","repositorySiteName":"app000003","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["app000003.azurewebsites.net","app000003.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"app000003.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"app000003.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/serverfarms/plan1","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-03-12T04:00:46.6566667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"keyVaultReferenceIdentity":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow - all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"app000003","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"253001F2FCF5A7B1CD759EB861E9BB1596370BE27E47A991F72184277B3D12F2","kind":"app","inboundIpAddress":"40.112.243.8","possibleInboundIpAddresses":"40.112.243.8","ftpUsername":"app000003\\$app000003","ftpsHostName":"ftps://waws-prod-bay-141.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.112.243.8,52.160.87.144,52.160.81.29,40.83.173.84,52.160.87.145","possibleOutboundIpAddresses":"40.112.243.8,52.160.87.144,52.160.81.29,40.83.173.84,52.160.87.145,52.160.69.205,40.118.207.199,52.160.67.221,52.160.67.220,52.160.67.45","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-141","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"cli_test_metric_alert_v2000001","defaultHostName":"app000003.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"app000003","slotName":null,"trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"253001F2FCF5A7B1CD759EB861E9BB1596370BE27E47A991F72184277B3D12F2","kind":"app","inboundIpAddress":"13.93.158.16","possibleInboundIpAddresses":"13.93.158.16","ftpUsername":"app000003\\$app000003","ftpsHostName":"ftps://waws-prod-bay-095.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"13.93.158.16,52.160.98.75,13.64.78.195,13.64.73.242,13.64.72.148","possibleOutboundIpAddresses":"13.93.158.16,52.160.98.75,13.64.78.195,13.64.73.242,13.64.72.148,13.64.75.221,13.64.78.152","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-095","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"cli_test_metric_alert_v2000001","defaultHostName":"app000003.azurewebsites.net","slotSwapStatus":null,"keyVaultReferenceIdentity":"SystemAssigned","httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '5962' + - '6008' content-type: - application/json date: - - Mon, 01 Feb 2021 07:59:00 GMT + - Fri, 12 Mar 2021 04:01:03 GMT etag: - - '"1D6F8700F686355"' + - '"1D716F448831360"' expires: - '-1' pragma: @@ -1382,8 +1512,8 @@ interactions: ParameterSetName: - -g -n -p User-Agent: - - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.8 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.20.0 accept-language: - en-US method: POST @@ -1392,22 +1522,22 @@ interactions: body: string: @@ -1419,7 +1549,7 @@ interactions: content-type: - application/xml date: - - Mon, 01 Feb 2021 07:59:01 GMT + - Fri, 12 Mar 2021 04:01:05 GMT expires: - '-1' pragma: @@ -1464,7 +1594,7 @@ interactions: ParameterSetName: - -g -n --scopes --region --action --description --condition User-Agent: - - AZURECLI/2.18.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Insights/metricAlerts/alert12?api-version=2018-03-01 response: @@ -1476,17 +1606,15 @@ interactions: [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/Microsoft.Web/sites/app000003\"\r\n \ ],\r\n \"evaluationFrequency\": \"PT1M\",\r\n \"windowSize\": \"PT5M\",\r\n \ \"criteria\": {\r\n \"allOf\": [\r\n {\r\n \"threshold\": - 10.0,\r\n \"name\": \"cond0\",\r\n \"metricNamespace\": - \"microsoft.web/sites\",\r\n \"metricName\": \"Http4xx\",\r\n \"dimensions\": - [\r\n {\r\n \"name\": \"Instance\",\r\n \"operator\": - \"Include\",\r\n \"values\": [\r\n \"*\"\r\n ]\r\n - \ }\r\n ],\r\n \"operator\": \"GreaterThan\",\r\n - \ \"timeAggregation\": \"Total\",\r\n \"criterionType\": - \"StaticThresholdCriterion\"\r\n }\r\n ],\r\n \"odata.type\": - \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n },\r\n - \ \"targetResourceType\": \"microsoft.web/sites\",\r\n \"targetResourceRegion\": - \"westus\",\r\n \"actions\": [\r\n {\r\n \"actionGroupId\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n + 10.0,\r\n \"name\": \"cond0\",\r\n \"metricName\": \"Http4xx\",\r\n + \ \"dimensions\": [\r\n {\r\n \"name\": \"Instance\",\r\n + \ \"operator\": \"Include\",\r\n \"values\": [\r\n + \ \"*\"\r\n ]\r\n }\r\n ],\r\n + \ \"operator\": \"GreaterThan\",\r\n \"timeAggregation\": + \"Total\",\r\n \"criterionType\": \"StaticThresholdCriterion\"\r\n + \ }\r\n ],\r\n \"odata.type\": \"Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria\"\r\n + \ },\r\n \"targetResourceRegion\": \"westus\",\r\n \"actions\": [\r\n + \ {\r\n \"actionGroupId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_metric_alert_v2000001/providers/microsoft.insights/actionGroups/ag1\"\r\n \ }\r\n ]\r\n }\r\n}" headers: api-supported-versions: @@ -1494,11 +1622,11 @@ interactions: cache-control: - no-cache content-length: - - '1682' + - '1579' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Feb 2021 07:59:16 GMT + - Fri, 12 Mar 2021 04:01:19 GMT expires: - '-1' pragma: @@ -1516,7 +1644,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '299' + - '298' x-powered-by: - ASP.NET status: diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py index 363f9014f2e..d77fb54d077 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py @@ -59,6 +59,11 @@ def test_metric_alert_v2_scenario(self, resource_group, storage_account): self.cmd('monitor metrics alert update -g {rg} -n {alert} --enabled false', checks=[ self.check('enabled', False) ]) + self.cmd('monitor metrics alert update -g {rg} -n {alert} --add-action ag2 test=best2', checks=[ + self.check("contains(actions[0].actionGroupId, 'actionGroups/ag2')", True), + self.check('length(actions)', 1) + ]) + self.cmd('monitor metrics alert list -g {rg}', checks=self.check('length(@)', 1)) self.cmd('monitor metrics alert show -g {rg} -n {alert}')