From 009bdaab60b504e1ef8974806991a2c981d3409f Mon Sep 17 00:00:00 2001 From: zhoxing Date: Wed, 15 Jan 2020 18:04:30 +0800 Subject: [PATCH] Fix the exit code of az group deployment validate when the verification fails --- src/azure-cli/HISTORY.rst | 4 + .../cli/command_modules/resource/custom.py | 5 +- .../recordings/test_group_deployment.yaml | 169 +++++++++--------- .../test_group_deployment_crossrg.yaml | 154 +++++++++++----- .../tests/latest/test-error-params.json | 17 ++ .../resource/tests/latest/test_resource.py | 9 + 6 files changed, 230 insertions(+), 128 deletions(-) create mode 100644 src/azure-cli/azure/cli/command_modules/resource/tests/latest/test-error-params.json diff --git a/src/azure-cli/HISTORY.rst b/src/azure-cli/HISTORY.rst index 955ce49d96d..b62476f4e22 100644 --- a/src/azure-cli/HISTORY.rst +++ b/src/azure-cli/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +**ARM** + +* Fix issue #10279: The exit code of `az group deployment validate` is 0 when the verification fails + **IoT Central** * Support app creation/update with the new sku name ST0, ST1, ST2. diff --git a/src/azure-cli/azure/cli/command_modules/resource/custom.py b/src/azure-cli/azure/cli/command_modules/resource/custom.py index 4787148f6d3..362eabc4608 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/custom.py +++ b/src/azure-cli/azure/cli/command_modules/resource/custom.py @@ -285,7 +285,10 @@ def _deploy_arm_template_core(cli_ctx, resource_group_name, smc = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, aux_subscriptions=aux_subscriptions) if validate_only: - return sdk_no_wait(no_wait, smc.deployments.validate, resource_group_name, deployment_name, properties) + response = sdk_no_wait(no_wait, smc.deployments.validate, resource_group_name, deployment_name, properties) + if response and response.error: + raise CLIError(response.error) + return response return sdk_no_wait(no_wait, smc.deployments.create_or_update, resource_group_name, deployment_name, properties) diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment.yaml index e53a6fe5137..5ee3a19ab06 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment.yaml +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment.yaml @@ -13,15 +13,15 @@ interactions: ParameterSetName: - -g -n --subnet-name User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001","name":"cli_test_deployment000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2019-10-21T05:12:15Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001","name":"cli_test_deployment000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-01-15T11:19:22Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -30,7 +30,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:18 GMT + - Wed, 15 Jan 2020 11:19:28 GMT expires: - '-1' pragma: @@ -64,8 +64,8 @@ interactions: ParameterSetName: - -g -n --subnet-name User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-network/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/7.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: PUT @@ -73,15 +73,15 @@ interactions: response: body: string: "{\r\n \"name\": \"vnet1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1\",\r\n - \ \"etag\": \"W/\\\"fedf2112-3e80-4663-a19a-54c5a9ff0441\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"0a97e232-118b-49cc-af6b-6dfb6154b1b1\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n - \ \"resourceGuid\": \"076a3d53-bff9-42b1-a9bc-bc75c154e0ff\",\r\n \"addressSpace\": + \ \"resourceGuid\": \"51973275-4577-43cd-950b-3c3ea8aa4f09\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n \ \"subnets\": [\r\n {\r\n \"name\": \"subnet1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1\",\r\n - \ \"etag\": \"W/\\\"fedf2112-3e80-4663-a19a-54c5a9ff0441\\\"\",\r\n + \ \"etag\": \"W/\\\"0a97e232-118b-49cc-af6b-6dfb6154b1b1\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": @@ -90,7 +90,7 @@ interactions: false,\r\n \"enableVmProtection\": false\r\n }\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/cfc1f09e-5164-447e-945e-eb2ca3466290?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/073ee1db-b9b3-4c82-bba7-5b186380e14c?api-version=2019-09-01 cache-control: - no-cache content-length: @@ -98,7 +98,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:20 GMT + - Wed, 15 Jan 2020 11:19:34 GMT expires: - '-1' pragma: @@ -111,9 +111,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 25150007-e1a4-40ef-afd2-7823fd288334 + - df951a2e-7987-4d60-992f-c36f58de64d3 x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1199' status: code: 201 message: Created @@ -131,10 +131,10 @@ interactions: ParameterSetName: - -g -n --subnet-name User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-network/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/7.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/cfc1f09e-5164-447e-945e-eb2ca3466290?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/073ee1db-b9b3-4c82-bba7-5b186380e14c?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -146,7 +146,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:24 GMT + - Wed, 15 Jan 2020 11:19:38 GMT expires: - '-1' pragma: @@ -163,7 +163,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - c156d53f-2576-47aa-beae-503c45e0e64e + - bb584383-6f87-437f-b181-08c357d0221a status: code: 200 message: OK @@ -181,22 +181,22 @@ interactions: ParameterSetName: - -g -n --subnet-name User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-network/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/7.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"vnet1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1\",\r\n - \ \"etag\": \"W/\\\"9d491187-540a-4434-ab92-1ee88918d1e3\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"6b888b57-a557-4dac-9de0-e3d00f6ce22d\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"076a3d53-bff9-42b1-a9bc-bc75c154e0ff\",\r\n \"addressSpace\": + \ \"resourceGuid\": \"51973275-4577-43cd-950b-3c3ea8aa4f09\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n \ \"subnets\": [\r\n {\r\n \"name\": \"subnet1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1\",\r\n - \ \"etag\": \"W/\\\"9d491187-540a-4434-ab92-1ee88918d1e3\\\"\",\r\n + \ \"etag\": \"W/\\\"6b888b57-a557-4dac-9de0-e3d00f6ce22d\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": @@ -211,9 +211,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:24 GMT + - Wed, 15 Jan 2020 11:19:38 GMT etag: - - W/"9d491187-540a-4434-ab92-1ee88918d1e3" + - W/"6b888b57-a557-4dac-9de0-e3d00f6ce22d" expires: - '-1' pragma: @@ -230,7 +230,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b831266a-b0df-41d1-a971-43e78e90d1c4 + - 15ca97d4-e1c2-494b-b17a-5b9d14c673aa status: code: 200 message: OK @@ -267,15 +267,15 @@ interactions: ParameterSetName: - -g --template-file --parameters --parameters --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/deployment_dry_run","name":"deployment_dry_run","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:12:27.0377022Z","duration":"PT0S","correlationId":"27d57c0c-20d2-4603-8e56-30587235c7a3","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/deployment_dry_run","name":"deployment_dry_run","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-15T11:19:40.9963117Z","duration":"PT0S","correlationId":"4f1ff81d-65b0-4be5-a026-e4e942c3fae7","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' headers: cache-control: - no-cache @@ -284,7 +284,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:27 GMT + - Wed, 15 Jan 2020 11:19:41 GMT expires: - '-1' pragma: @@ -310,7 +310,7 @@ interactions: Host: - raw.githubusercontent.com User-Agent: - - Python-urllib/3.7 + - Python-urllib/3.8 method: GET uri: https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test-params.json response: @@ -337,11 +337,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:28 GMT + - Wed, 15 Jan 2020 11:19:42 GMT etag: - - '"ef8b30fdcb3a6ea0775ede205d6d014b9d7d63d9"' + - W/"f36881c8934a00ae2ab8c82dbef30707c182d33e0455bdb88181a7adf111b94c" expires: - - Mon, 21 Oct 2019 05:17:28 GMT + - Wed, 15 Jan 2020 11:24:42 GMT source-age: - '0' strict-transport-security: @@ -349,6 +349,7 @@ interactions: vary: - Authorization,Accept-Encoding, Accept-Encoding via: + - 1.1 varnish-v4 - 1.1 varnish x-cache: - MISS @@ -357,17 +358,17 @@ interactions: x-content-type-options: - nosniff x-fastly-request-id: - - 52910e61dfd73eb4820e8cd06e3bbd08cdb296e1 + - 1f776a495f0e8d59650895fc3f8bd564fa807632 x-frame-options: - deny x-geo-block-list: - '' x-github-request-id: - - E6B4:71BA:6A7B9F:7296DD:5DAD3E3B + - D80C:3463:127196:13A626:5E1EF54D x-served-by: - - cache-sin18034-SIN + - cache-sin18035-SIN x-timer: - - S1571634748.199986,VS0,VE337 + - S1579087182.935558,VS0,VE300 x-xss-protection: - 1; mode=block status: @@ -406,15 +407,15 @@ interactions: ParameterSetName: - -g --template-file --parameters --parameters --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/deployment_dry_run","name":"deployment_dry_run","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:12:29.4580251Z","duration":"PT0S","correlationId":"a5c64b00-12f9-456c-b82a-5cb81d760ce6","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/deployment_dry_run","name":"deployment_dry_run","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-15T11:19:43.6829581Z","duration":"PT0S","correlationId":"f4880aad-64a8-4c85-8e81-aa3b7b3c39d6","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' headers: cache-control: - no-cache @@ -423,7 +424,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:28 GMT + - Wed, 15 Jan 2020 11:19:43 GMT expires: - '-1' pragma: @@ -474,26 +475,26 @@ interactions: ParameterSetName: - -g -n --template-file --parameters --parameters --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2019-10-21T05:12:33.7352344Z","duration":"PT2.40981S","correlationId":"69d03a2c-a1cf-436a-8f35-798c4a7dfffb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-01-15T11:19:49.3544318Z","duration":"PT2.6812664S","correlationId":"fbf614d0-f2e3-4446-b4dc-eade16009e55","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment/operationStatuses/08586299721341521922?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment/operationStatuses/08586225196988044554?api-version=2019-07-01 cache-control: - no-cache content-length: - - '1210' + - '1212' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:34 GMT + - Wed, 15 Jan 2020 11:19:50 GMT expires: - '-1' pragma: @@ -503,7 +504,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' status: code: 201 message: Created @@ -521,10 +522,10 @@ interactions: ParameterSetName: - -g -n --template-file --parameters --parameters --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586299721341521922?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586225196988044554?api-version=2019-07-01 response: body: string: '{"status":"Succeeded"}' @@ -536,7 +537,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:05 GMT + - Wed, 15 Jan 2020 11:20:20 GMT expires: - '-1' pragma: @@ -564,22 +565,22 @@ interactions: ParameterSetName: - -g -n --template-file --parameters --parameters --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:12:55.3275849Z","duration":"PT24.0021605S","correlationId":"69d03a2c-a1cf-436a-8f35-798c4a7dfffb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-15T11:20:11.9982204Z","duration":"PT25.325055S","correlationId":"fbf614d0-f2e3-4446-b4dc-eade16009e55","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' headers: cache-control: - no-cache content-length: - - '1436' + - '1435' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:05 GMT + - Wed, 15 Jan 2020 11:20:22 GMT expires: - '-1' pragma: @@ -607,8 +608,8 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-network/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/7.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET @@ -616,13 +617,13 @@ interactions: response: body: string: "{\r\n \"name\": \"test-lb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb\",\r\n - \ \"etag\": \"W/\\\"f0b39519-1dd4-4ecb-8579-a418f9c57d01\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"397aa7c2-d02e-4d20-9e30-fd073e5a23fc\\\"\",\r\n \"type\": \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"westus\",\r\n \"tags\": {\r\n \"key\": \"super=value\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"089701ae-3503-4908-ab83-90d69f627b49\",\r\n + \"Succeeded\",\r\n \"resourceGuid\": \"5d655886-97b9-4f63-99d0-aa26bc6262e2\",\r\n \ \"frontendIPConfigurations\": [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"f0b39519-1dd4-4ecb-8579-a418f9c57d01\\\"\",\r\n + \ \"etag\": \"W/\\\"397aa7c2-d02e-4d20-9e30-fd073e5a23fc\\\"\",\r\n \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": @@ -630,27 +631,27 @@ interactions: \ },\r\n \"privateIPAddressVersion\": \"IPv4\"\r\n }\r\n \ }\r\n ],\r\n \"backendAddressPools\": [\r\n {\r\n \"name\": \"bepool1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb/backendAddressPools/bepool1\",\r\n - \ \"etag\": \"W/\\\"f0b39519-1dd4-4ecb-8579-a418f9c57d01\\\"\",\r\n + \ \"etag\": \"W/\\\"397aa7c2-d02e-4d20-9e30-fd073e5a23fc\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n \ },\r\n \"type\": \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n \ },\r\n {\r\n \"name\": \"bepool2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb/backendAddressPools/bepool2\",\r\n - \ \"etag\": \"W/\\\"f0b39519-1dd4-4ecb-8579-a418f9c57d01\\\"\",\r\n + \ \"etag\": \"W/\\\"397aa7c2-d02e-4d20-9e30-fd073e5a23fc\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n \ },\r\n \"type\": \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n \ }\r\n ],\r\n \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \ \"inboundNatRules\": [],\r\n \"inboundNatPools\": []\r\n },\r\n \"sku\": - {\r\n \"name\": \"Basic\",\r\n \"tier\": \"Regional\"\r\n }\r\n}" + {\r\n \"name\": \"Basic\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '2722' + - '2697' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:07 GMT + - Wed, 15 Jan 2020 11:20:23 GMT etag: - - W/"f0b39519-1dd4-4ecb-8579-a418f9c57d01" + - W/"397aa7c2-d02e-4d20-9e30-fd073e5a23fc" expires: - '-1' pragma: @@ -667,7 +668,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 6441fc3d-8dae-4441-870f-ffd63e995610 + - 69e1df53-9c4c-4f58-8906-7398738fedfc status: code: 200 message: OK @@ -685,24 +686,24 @@ interactions: ParameterSetName: - -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/?api-version=2019-07-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:12:55.3275849Z","duration":"PT24.0021605S","correlationId":"69d03a2c-a1cf-436a-8f35-798c4a7dfffb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-15T11:20:11.9982204Z","duration":"PT25.325055S","correlationId":"fbf614d0-f2e3-4446-b4dc-eade16009e55","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}]}' headers: cache-control: - no-cache content-length: - - '1448' + - '1447' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:09 GMT + - Wed, 15 Jan 2020 11:20:23 GMT expires: - '-1' pragma: @@ -730,24 +731,24 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:12:55.3275849Z","duration":"PT24.0021605S","correlationId":"69d03a2c-a1cf-436a-8f35-798c4a7dfffb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16281834986780566039","parameters":{"name":{"type":"String","value":"test-lb"},"location":{"type":"String","value":"westus"},"subnetId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},"privateIPAllocationMethod":{"type":"String","value":"Dynamic"},"backendAddressPools":{"type":"Array","value":[{"name":"bepool1"},{"name":"bepool2"}]},"tags":{"type":"Object","value":{"key":"super=value"}}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-15T11:20:11.9982204Z","duration":"PT25.325055S","correlationId":"fbf614d0-f2e3-4446-b4dc-eade16009e55","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"loadBalancers","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb"}]}}' headers: cache-control: - no-cache content-length: - - '1436' + - '1435' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:10 GMT + - Wed, 15 Jan 2020 11:20:25 GMT expires: - '-1' pragma: @@ -775,15 +776,15 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment000001/deployments/mock-deployment/operations?api-version=2019-07-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment/operations/072895F0DAD2F921","operationId":"072895F0DAD2F921","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2019-10-21T05:12:55.1943789Z","duration":"PT20.7796566S","trackingId":"c741cef2-5ec5-4079-8338-73d7238c99a9","serviceRequestId":"d563b47c-218a-410e-b454-e2a9d335718c","statusCode":"Created","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb","resourceType":"Microsoft.Network/loadBalancers","resourceName":"test-lb"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment/operations/08586299721341521922","operationId":"08586299721341521922","properties":{"provisioningOperation":"EvaluateDeploymentOutput","provisioningState":"Succeeded","timestamp":"2019-10-21T05:12:55.3005662Z","duration":"PT0.0372306S","trackingId":"12dd677b-3e0e-4aad-9ecc-874f2c10ab0f","statusCode":"OK","statusMessage":null}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment/operations/986C12A92F621188","operationId":"986C12A92F621188","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-01-15T11:20:11.8926434Z","duration":"PT16.9672535S","trackingId":"02092ad3-4276-4839-a08c-070147aabafb","serviceRequestId":"2fa10f58-d4a2-422f-9d00-b719283264b1","statusCode":"Created","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Network/loadBalancers/test-lb","resourceType":"Microsoft.Network/loadBalancers","resourceName":"test-lb"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-deployment/operations/08586225196988044554","operationId":"08586225196988044554","properties":{"provisioningOperation":"EvaluateDeploymentOutput","provisioningState":"Succeeded","timestamp":"2020-01-15T11:20:11.9752286Z","duration":"PT0.0419367S","trackingId":"b4cc0d66-9c72-431b-b645-bf5ff07c201d","statusCode":"OK","statusMessage":null}}]}' headers: cache-control: - no-cache @@ -792,7 +793,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:12 GMT + - Wed, 15 Jan 2020 11:20:26 GMT expires: - '-1' pragma: diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_crossrg.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_crossrg.yaml index 1172a8d3394..b27f19d38eb 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_crossrg.yaml +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_crossrg.yaml @@ -15,8 +15,8 @@ interactions: "parameters": {}}}, {"type": "Microsoft.Storage/storageAccounts", "name": "[parameters(\''StorageAccountName1\'')]", "apiVersion": "2015-06-15", "location": "West US", "properties": {"accountType": "Standard_LRS"}}]}, "parameters": {"CrossRg": {"value": "cli_test_cross_rg_alt000001"}, - "StorageAccountName1": {"value": "crossrgzochafro6bwnfozy3"}, "StorageAccountName2": - {"value": "crossrgazfemp2qj5nwqyvkp"}}, "mode": "Incremental"}}''' + "StorageAccountName1": {"value": "crossrggxwmcv42avtkg62x7"}, "StorageAccountName2": + {"value": "crossrg3hutryezyc733luqb"}}, "mode": "Incremental"}}''' headers: Accept: - application/json @@ -33,15 +33,15 @@ interactions: ParameterSetName: - -g --template-file --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/deployment_dry_run","name":"deployment_dry_run","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"crossrgzochafro6bwnfozy3"},"storageAccountName2":{"type":"String","value":"crossrgazfemp2qj5nwqyvkp"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:13:48.7360537Z","duration":"PT0S","correlationId":"b1aeb0be-de64-46db-8dc5-cdbc27536e43","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Resources/deployments/nestedTemplate"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/crossrgzochafro6bwnfozy3"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/crossrgazfemp2qj5nwqyvkp"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/deployment_dry_run","name":"deployment_dry_run","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"crossrggxwmcv42avtkg62x7"},"storageAccountName2":{"type":"String","value":"crossrg3hutryezyc733luqb"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-14T03:31:10.0672347Z","duration":"PT0S","correlationId":"32d6e140-f0c0-467c-a2c7-09a37853b75f","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Resources/deployments/nestedTemplate"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/crossrggxwmcv42avtkg62x7"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/crossrg3hutryezyc733luqb"}]}}' headers: cache-control: - no-cache @@ -50,7 +50,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:50 GMT + - Tue, 14 Jan 2020 03:31:11 GMT expires: - '-1' pragma: @@ -64,10 +64,78 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"StorageAccountName1": {"type": + "string", "defaultValue": "test1ddosdatest72"}, "StorageAccountName2": {"type": + "string", "defaultValue": "test1ddfosatdest73"}, "CrossRg": {"type": "string", + "defaultValue": "crossrg5"}}, "variables": {}, "resources": [{"apiVersion": + "2017-05-10", "name": "nestedTemplate", "type": "Microsoft.Resources/deployments", + "resourceGroup": "[parameters(''CrossRg'')]", "properties": {"mode": "Incremental", + "template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {}, "variables": {}, "resources": + [{"type": "Microsoft.Storage/storageAccounts", "name": "[parameters(''StorageAccountName2'')]", + "apiVersion": "2015-06-15", "location": "West US", "properties": {"accountType": + "Standard_LRS"}}], "outputs": {"result": {"value": "Hello World", "type": "string"}}}, + "parameters": {}}}, {"type": "Microsoft.Storage/storageAccounts", "name": "[parameters(''StorageAccountName1'')]", + "apiVersion": "2015-06-15", "location": "West US", "properties": {"accountType": + "Standard_LRS"}}]}, "parameters": {"CrossRg": {"value": "test"}, "StorageAccountName1": + {"value": "crossrggxwmcv42avtkg62x7"}, "StorageAccountName2": {"value": "crossrg3hutryezyc733luqb"}}, + "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group deployment validate + Connection: + - keep-alive + Content-Length: + - '1452' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --template-file --parameters + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2019-07-01 + response: + body: + string: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group + ''test'' could not be found."}}' + headers: + cache-control: + - no-cache + content-length: + - '96' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Jan 2020 03:31:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 404 + message: Not Found - request: body: 'b''{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": {"StorageAccountName1": {"type": @@ -101,26 +169,26 @@ interactions: ParameterSetName: - -g -n --template-file --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2019-10-21T05:13:52.7727548Z","duration":"PT0.9774752S","correlationId":"b06be8a9-6568-4406-b955-da6bc7a0e451","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-01-14T03:31:18.5411728Z","duration":"PT2.487047S","correlationId":"2720a66b-9e27-43f8-9cd3-851eb114c9a3","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operationStatuses/08586299720536823443?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operationStatuses/08586226342094234966?api-version=2019-07-01 cache-control: - no-cache content-length: - - '1064' + - '1063' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:53 GMT + - Tue, 14 Jan 2020 03:31:19 GMT expires: - '-1' pragma: @@ -130,7 +198,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1197' status: code: 201 message: Created @@ -148,10 +216,10 @@ interactions: ParameterSetName: - -g -n --template-file --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586299720536823443?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586226342094234966?api-version=2019-07-01 response: body: string: '{"status":"Running"}' @@ -163,7 +231,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:14:24 GMT + - Tue, 14 Jan 2020 03:31:50 GMT expires: - '-1' pragma: @@ -191,10 +259,10 @@ interactions: ParameterSetName: - -g -n --template-file --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586299720536823443?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586226342094234966?api-version=2019-07-01 response: body: string: '{"status":"Running"}' @@ -206,7 +274,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:14:54 GMT + - Tue, 14 Jan 2020 03:32:20 GMT expires: - '-1' pragma: @@ -234,10 +302,10 @@ interactions: ParameterSetName: - -g -n --template-file --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586299720536823443?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586226342094234966?api-version=2019-07-01 response: body: string: '{"status":"Succeeded"}' @@ -249,7 +317,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:15:24 GMT + - Tue, 14 Jan 2020 03:32:51 GMT expires: - '-1' pragma: @@ -277,13 +345,13 @@ interactions: ParameterSetName: - -g -n --template-file --parameters User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:15:20.6877058Z","duration":"PT1M28.8924262S","correlationId":"b06be8a9-6568-4406-b955-da6bc7a0e451","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/test1ddfosatdest73"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-14T03:32:33.5517904Z","duration":"PT1M17.4976646S","correlationId":"2720a66b-9e27-43f8-9cd3-851eb114c9a3","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/test1ddfosatdest73"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72"}]}}' headers: cache-control: - no-cache @@ -292,7 +360,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:15:24 GMT + - Tue, 14 Jan 2020 03:32:52 GMT expires: - '-1' pragma: @@ -320,15 +388,15 @@ interactions: ParameterSetName: - -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/?api-version=2019-07-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:15:20.6877058Z","duration":"PT1M28.8924262S","correlationId":"b06be8a9-6568-4406-b955-da6bc7a0e451","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/test1ddfosatdest73"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72"}]}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-14T03:32:33.5517904Z","duration":"PT1M17.4976646S","correlationId":"2720a66b-9e27-43f8-9cd3-851eb114c9a3","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/test1ddfosatdest73"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72"}]}}]}' headers: cache-control: - no-cache @@ -337,7 +405,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:15:27 GMT + - Tue, 14 Jan 2020 03:32:53 GMT expires: - '-1' pragma: @@ -365,15 +433,15 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-10-21T05:15:20.6877058Z","duration":"PT1M28.8924262S","correlationId":"b06be8a9-6568-4406-b955-da6bc7a0e451","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/test1ddfosatdest73"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003","name":"azure-cli-crossrgdeployment000003","type":"Microsoft.Resources/deployments","properties":{"templateHash":"364931828683175221","parameters":{"storageAccountName1":{"type":"String","value":"test1ddosdatest72"},"storageAccountName2":{"type":"String","value":"test1ddfosatdest73"},"crossRg":{"type":"String","value":"cli_test_cross_rg_alt000001"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-01-14T03:32:33.5517904Z","duration":"PT1M17.4976646S","correlationId":"2720a66b-9e27-43f8-9cd3-851eb114c9a3","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"deployments","locations":[null]}]},{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Storage/storageAccounts/test1ddfosatdest73"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72"}]}}' headers: cache-control: - no-cache @@ -382,7 +450,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:15:28 GMT + - Tue, 14 Jan 2020 03:32:54 GMT expires: - '-1' pragma: @@ -410,24 +478,24 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cross_rg_deploy000002/deployments/mock-deployment/operations?api-version=2019-07-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operations/99E95636B3044E34","operationId":"99E95636B3044E34","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2019-10-21T05:14:55.4483619Z","duration":"PT54.2691686S","trackingId":"d76571ff-782b-442e-9696-634c0fbd6951","serviceRequestId":"533ae9f5-d73c-48cc-9ee9-163b80b7ea5d","statusCode":"OK","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72","resourceType":"Microsoft.Storage/storageAccounts","resourceName":"test1ddosdatest72"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operations/AA81733B28383C7C","operationId":"AA81733B28383C7C","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2019-10-21T05:15:20.4452935Z","duration":"PT1M19.2661002S","trackingId":"20538a92-abce-4f33-bb4d-ce09dca2b0c7","serviceRequestId":"a386851d-dfb7-4c6f-970a-d931e109af95","statusCode":"OK","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Resources/deployments/nestedTemplate","resourceType":"Microsoft.Resources/deployments","resourceName":"nestedTemplate"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operations/08586299720536823443","operationId":"08586299720536823443","properties":{"provisioningOperation":"EvaluateDeploymentOutput","provisioningState":"Succeeded","timestamp":"2019-10-21T05:15:20.6604435Z","duration":"PT0.0847271S","trackingId":"a40a4182-7485-4901-9bf3-3d9c9b4d4e90","statusCode":"OK","statusMessage":null}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operations/C3AFA4FB5CA53745","operationId":"C3AFA4FB5CA53745","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-01-14T03:32:11.1672369Z","duration":"PT48.3964518S","trackingId":"35c3ac90-52ed-494d-8b5c-46417aa77411","serviceRequestId":"8d849f89-1f64-4924-af65-8643c08bee3b","statusCode":"OK","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Storage/storageAccounts/test1ddosdatest72","resourceType":"Microsoft.Storage/storageAccounts","resourceName":"test1ddosdatest72"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operations/F6B020413A8D31F2","operationId":"F6B020413A8D31F2","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-01-14T03:32:32.2149084Z","duration":"PT1M9.4441233S","trackingId":"abffd566-b070-4b19-80b7-4181cc98ebb5","serviceRequestId":"d2c0a07a-acea-401f-9138-b5c2d6a83792","statusCode":"OK","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_alt000001/providers/Microsoft.Resources/deployments/nestedTemplate","resourceType":"Microsoft.Resources/deployments","resourceName":"nestedTemplate"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cross_rg_deploy000002/providers/Microsoft.Resources/deployments/azure-cli-crossrgdeployment000003/operations/08586226342094234966","operationId":"08586226342094234966","properties":{"provisioningOperation":"EvaluateDeploymentOutput","provisioningState":"Succeeded","timestamp":"2020-01-14T03:32:33.3347914Z","duration":"PT0.6954135S","trackingId":"53152182-6f4e-4b8f-8bdc-b6517039a035","statusCode":"OK","statusMessage":null}}]}' headers: cache-control: - no-cache content-length: - - '2347' + - '2346' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:15:30 GMT + - Tue, 14 Jan 2020 03:32:55 GMT expires: - '-1' pragma: diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test-error-params.json b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test-error-params.json new file mode 100644 index 00000000000..ce6c5c4e13a --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test-error-params.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "test-lb" + }, + "location": { + "value": "westus" + }, + "tags": { + "value": { + "key": "super=value" + } + } + } +} \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py index 25a57feea51..7a8b88eba16 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py @@ -13,6 +13,7 @@ from azure_devtools.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, create_random_name, live_only, record_only from azure.cli.core.util import get_file_json +from knack.util import CLIError class ResourceGroupScenarioTest(ScenarioTest): @@ -423,6 +424,7 @@ def test_group_deployment(self, resource_group): self.kwargs.update({ 'tf': os.path.join(curr_dir, 'test-template.json').replace('\\', '\\\\'), 'params': os.path.join(curr_dir, 'test-params.json').replace('\\', '\\\\'), + 'error_params': os.path.join(curr_dir, 'test-error-params.json').replace('\\', '\\\\'), # params-uri below is the raw file url of the test_params.json above 'params_uri': 'https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test-params.json', 'of': os.path.join(curr_dir, 'test-object.json').replace('\\', '\\\\'), @@ -438,6 +440,9 @@ def test_group_deployment(self, resource_group): self.check('properties.provisioningState', 'Succeeded') ]) + with self.assertRaises(CLIError): + self.cmd('group deployment validate -g {rg} --template-file {tf} --parameters @"{error_params}" --parameters subnetId="{subnet_id}" --parameters backendAddressPools=@"{of}"') + self.cmd('group deployment create -g {rg} -n {dn} --template-file {tf} --parameters @"{params}" --parameters subnetId="{subnet_id}" --parameters backendAddressPools=@"{of}"', checks=[ self.check('properties.provisioningState', 'Succeeded'), self.check('resourceGroup', '{rg}') @@ -1319,6 +1324,10 @@ def test_group_deployment_crossrg(self, resource_group, resource_group_cross): self.cmd('group deployment validate -g {rg1} --template-file "{tf}" --parameters CrossRg={rg2} StorageAccountName1={sa1} StorageAccountName2={sa2}', checks=[ self.check('properties.provisioningState', 'Succeeded') ]) + + with self.assertRaises(CLIError): + self.cmd('group deployment validate -g {rg1} --template-file "{tf}" --parameters CrossRg=test StorageAccountName1={sa1} StorageAccountName2={sa2}') + self.cmd('group deployment create -g {rg1} -n {dn} --template-file "{tf}" --parameters CrossRg={rg2}', checks=[ self.check('properties.provisioningState', 'Succeeded'), self.check('resourceGroup', '{rg1}'),