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 508a8b15eb0..736e2b55333 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/custom.py +++ b/src/azure-cli/azure/cli/command_modules/resource/custom.py @@ -291,8 +291,7 @@ def _deploy_arm_template_core_unmodified(cli_ctx, resource_group_name, template_ template_content = None if template_uri: template_link = TemplateLink(uri=template_uri) - template_content = _urlretrieve(template_uri).decode('utf-8') - template_obj = _remove_comments_from_json(template_content) + template_obj = _remove_comments_from_json(_urlretrieve(template_uri).decode('utf-8')) else: template_content = read_file_content(template_file) template_obj = _remove_comments_from_json(template_content) @@ -317,30 +316,32 @@ def _deploy_arm_template_core_unmodified(cli_ctx, resource_group_name, template_ deployment_client = smc.deployments # This solves the multi-api for you - # pylint: disable=protected-access - deployment_client._serialize = JSONSerializer( - deployment_client._serialize.dependencies - ) - - # Plug this as default HTTP pipeline - from msrest.pipeline import Pipeline - from msrest.pipeline.requests import ( - RequestsCredentialsPolicy, - RequestsPatchSession, - PipelineRequestsHTTPSender - ) - from msrest.universal_http.requests import RequestsHTTPSender - - smc.config.pipeline = Pipeline( - policies=[ - JsonCTemplatePolicy(), - smc.config.user_agent_policy, - RequestsPatchSession(), - smc.config.http_logger_policy, - RequestsCredentialsPolicy(smc.config.credentials) - ], - sender=PipelineRequestsHTTPSender(RequestsHTTPSender(smc.config)) - ) + if not template_uri: + + # pylint: disable=protected-access + deployment_client._serialize = JSONSerializer( + deployment_client._serialize.dependencies + ) + + # Plug this as default HTTP pipeline + from msrest.pipeline import Pipeline + from msrest.pipeline.requests import ( + RequestsCredentialsPolicy, + RequestsPatchSession, + PipelineRequestsHTTPSender + ) + from msrest.universal_http.requests import RequestsHTTPSender + + smc.config.pipeline = Pipeline( + policies=[ + JsonCTemplatePolicy(), + smc.config.user_agent_policy, + RequestsPatchSession(), + smc.config.http_logger_policy, + RequestsCredentialsPolicy(smc.config.credentials) + ], + sender=PipelineRequestsHTTPSender(RequestsHTTPSender(smc.config)) + ) validation_result = deployment_client.validate(resource_group_name=resource_group_name, deployment_name=deployment_name, properties=properties) @@ -431,7 +432,7 @@ def _deploy_arm_template_at_subscription_scope(cli_ctx, mode='Incremental', no_prompt=no_prompt) - mgmt_client = _get_deployment_management_client(cli_ctx) + mgmt_client = _get_deployment_management_client(cli_ctx, plug_pipeline=(template_uri is None)) validation_result = mgmt_client.validate_at_subscription_scope(deployment_name=deployment_name, properties=deployment_properties, location=deployment_location) @@ -496,7 +497,7 @@ def _deploy_arm_template_at_resource_group(cli_ctx, no_prompt=no_prompt) mgmt_client = _get_deployment_management_client(cli_ctx, aux_subscriptions=aux_subscriptions, - aux_tenants=aux_tenants) + aux_tenants=aux_tenants, plug_pipeline=(template_uri is None)) validation_result = mgmt_client.validate(resource_group_name=resource_group_name, deployment_name=deployment_name, properties=deployment_properties) @@ -548,7 +549,7 @@ def _deploy_arm_template_at_management_group(cli_ctx, parameters=parameters, mode='Incremental', no_prompt=no_prompt) - mgmt_client = _get_deployment_management_client(cli_ctx) + mgmt_client = _get_deployment_management_client(cli_ctx, plug_pipeline=(template_uri is None)) validation_result = mgmt_client.validate_at_management_group_scope(group_id=management_group_id, deployment_name=deployment_name, properties=deployment_properties, location=deployment_location) @@ -594,7 +595,7 @@ def _deploy_arm_template_at_tenant_scope(cli_ctx, parameters=parameters, mode='Incremental', no_prompt=no_prompt) - mgmt_client = _get_deployment_management_client(cli_ctx) + mgmt_client = _get_deployment_management_client(cli_ctx, plug_pipeline=(template_uri is None)) validation_result = mgmt_client.validate_at_tenant_scope(deployment_name=deployment_name, properties=deployment_properties, location=deployment_location) @@ -614,7 +615,8 @@ def what_if_deploy_arm_template_at_resource_group(cmd, resource_group_name, no_pretty_print=None, no_prompt=False): what_if_properties = _prepare_deployment_what_if_properties(cmd.cli_ctx, template_file, template_uri, parameters, mode, result_format, no_prompt) - mgmt_client = _get_deployment_management_client(cmd.cli_ctx, aux_tenants=aux_tenants) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, aux_tenants=aux_tenants, + plug_pipeline=(template_uri is None)) what_if_poller = mgmt_client.what_if(resource_group_name, deployment_name, what_if_properties) return _what_if_deploy_arm_template_core(cmd.cli_ctx, what_if_poller, no_pretty_print) @@ -626,7 +628,7 @@ def what_if_deploy_arm_template_at_subscription_scope(cmd, result_format=None, no_pretty_print=None, no_prompt=False): what_if_properties = _prepare_deployment_what_if_properties(cmd.cli_ctx, template_file, template_uri, parameters, DeploymentMode.incremental, result_format, no_prompt) - mgmt_client = _get_deployment_management_client(cmd.cli_ctx) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None)) what_if_poller = mgmt_client.what_if_at_subscription_scope(deployment_name, what_if_properties, deployment_location) return _what_if_deploy_arm_template_core(cmd.cli_ctx, what_if_poller, no_pretty_print) @@ -670,8 +672,7 @@ def _prepare_deployment_properties_unmodified(cli_ctx, template_file=None, templ template_content = None if template_uri: template_link = TemplateLink(uri=template_uri) - template_content = _urlretrieve(template_uri).decode('utf-8') - template_obj = _remove_comments_from_json(template_content) + template_obj = _remove_comments_from_json(_urlretrieve(template_uri).decode('utf-8')) else: template_content = read_file_content(template_file) template_obj = _remove_comments_from_json(template_content) @@ -709,36 +710,37 @@ def _prepare_deployment_what_if_properties(cli_ctx, template_file, template_uri, return deployment_what_if_properties -def _get_deployment_management_client(cli_ctx, aux_subscriptions=None, aux_tenants=None): +def _get_deployment_management_client(cli_ctx, aux_subscriptions=None, aux_tenants=None, plug_pipeline=True): smc = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, aux_subscriptions=aux_subscriptions, aux_tenants=aux_tenants) deployment_client = smc.deployments # This solves the multi-api for you - # pylint: disable=protected-access - deployment_client._serialize = JSONSerializer( - deployment_client._serialize.dependencies - ) - - # Plug this as default HTTP pipeline - from msrest.pipeline import Pipeline - from msrest.pipeline.requests import ( - RequestsCredentialsPolicy, - RequestsPatchSession, - PipelineRequestsHTTPSender - ) - from msrest.universal_http.requests import RequestsHTTPSender - - smc.config.pipeline = Pipeline( - policies=[ - JsonCTemplatePolicy(), - smc.config.user_agent_policy, - RequestsPatchSession(), - smc.config.http_logger_policy, - RequestsCredentialsPolicy(smc.config.credentials) - ], - sender=PipelineRequestsHTTPSender(RequestsHTTPSender(smc.config)) - ) + if plug_pipeline: + # pylint: disable=protected-access + deployment_client._serialize = JSONSerializer( + deployment_client._serialize.dependencies + ) + + # Plug this as default HTTP pipeline + from msrest.pipeline import Pipeline + from msrest.pipeline.requests import ( + RequestsCredentialsPolicy, + RequestsPatchSession, + PipelineRequestsHTTPSender + ) + from msrest.universal_http.requests import RequestsHTTPSender + + smc.config.pipeline = Pipeline( + policies=[ + JsonCTemplatePolicy(), + smc.config.user_agent_policy, + RequestsPatchSession(), + smc.config.http_logger_policy, + RequestsCredentialsPolicy(smc.config.credentials) + ], + sender=PipelineRequestsHTTPSender(RequestsHTTPSender(smc.config)) + ) return deployment_client diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_thru_uri.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_thru_uri.yaml index af75388b115..a40cce9400e 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_thru_uri.yaml +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_thru_uri.yaml @@ -7,7 +7,7 @@ interactions: Host: - raw.githubusercontent.com User-Agent: - - Python-urllib/3.6 + - 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/simple_deploy.json response: @@ -23,8 +23,11 @@ interactions: \"[parameters('name')]\",\n \"apiVersion\": \"2015-06-15\",\n \"location\": \"[parameters('location')]\",\n \"properties\": {\n \"securityRules\": [\n ]\n },\n \"dependsOn\": [ ]\n }\n ],\n \"outputs\": - {\n \"NewNSG\": {\n \"type\": \"object\",\n \"value\": \"[reference(parameters('name'))]\"\n - \ }\n }\n}\n" + {\n \"NewNSG\": {\n /** comment1\n comment2\n comment3\n + \ **/\n // comment\n /** comment **/\n \"type\": \"object\", + /** comment **/\n \"value\": \"[reference(parameters('name'))]\" // comment\n + \ // comment\n /** comment **/\n /** comment1\n comment2\n + \ comment3\n **/\n }\n } // comment\n}\n" headers: accept-ranges: - bytes @@ -35,17 +38,17 @@ interactions: connection: - close content-length: - - '918' + - '1168' content-security-policy: - default-src 'none'; style-src 'unsafe-inline'; sandbox content-type: - text/plain; charset=utf-8 date: - - Sat, 14 Dec 2019 01:24:10 GMT + - Wed, 06 May 2020 08:26:46 GMT etag: - - '"dc2e1804cbedd7296f9bda3dbce20868dbfdd4629126625d456e16131c7d2f2f"' + - W/"997394d4fe7eedc3fef1deb4f9b203ec0ad6f2de1061196b567e3c602c008915" expires: - - Sat, 14 Dec 2019 01:29:10 GMT + - Wed, 06 May 2020 08:31:46 GMT source-age: - '0' strict-transport-security: @@ -53,25 +56,24 @@ interactions: vary: - Authorization,Accept-Encoding via: + - 1.1 varnish (Varnish/6.0) - 1.1 varnish x-cache: - - MISS + - MISS, MISS x-cache-hits: - - '0' + - 0, 0 x-content-type-options: - nosniff x-fastly-request-id: - - dea7030fd00477bc049458358d6647d3825fec23 + - 2ca19cbb5e4e2c1be07723a3a52bedf35eeae112 x-frame-options: - deny - x-geo-block-list: - - '' x-github-request-id: - - F850:4182:3100:42AB:5DF439B9 + - D7A6:163A:20D7DD:272078:5EB274C6 x-served-by: - - cache-sjc10030-SJC + - cache-hkg17926-HKG x-timer: - - S1576286650.455455,VS0,VE171 + - S1588753607.666194,VS0,VE306 x-xss-protection: - 1; mode=block status: @@ -97,15 +99,15 @@ interactions: ParameterSetName: - -g --template-uri --parameters User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 accept-language: - en-US method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/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_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-12-14T01:24:10.9203349Z","duration":"PT0S","correlationId":"819a0948-44e0-4f86-b4a5-4f3beef2b4b3","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-05-06T08:26:49.6456348Z","duration":"PT0S","correlationId":"59671d3f-f831-4dc7-9430-b9e513c85390","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' headers: cache-control: - no-cache @@ -114,7 +116,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:24:10 GMT + - Wed, 06 May 2020 08:26:49 GMT expires: - '-1' pragma: @@ -128,7 +130,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -152,18 +154,18 @@ interactions: ParameterSetName: - -g --template-uri --parameters User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 accept-language: - en-US method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2019-12-14T01:24:11.6605938Z","duration":"PT0.4112336S","correlationId":"c0f08121-ed54-4721-9e9b-a14c7085a2b2","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-05-06T08:26:53.7186998Z","duration":"PT1.7482058S","correlationId":"dddd5cc0-5559-4940-844e-c7ef5e8994e4","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy/operationStatuses/08586253202342282613?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy/operationStatuses/08586128532735071221?api-version=2019-07-01 cache-control: - no-cache content-length: @@ -171,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:24:11 GMT + - Wed, 06 May 2020 08:26:54 GMT expires: - '-1' pragma: @@ -199,22 +201,22 @@ interactions: ParameterSetName: - -g --template-uri --parameters User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586253202342282613?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586128532735071221?api-version=2019-07-01 response: body: - string: '{"status":"Running"}' + string: '{"status":"Succeeded"}' headers: cache-control: - no-cache content-length: - - '20' + - '22' content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:24:41 GMT + - Wed, 06 May 2020 08:27:25 GMT expires: - '-1' pragma: @@ -242,22 +244,28 @@ interactions: ParameterSetName: - -g --template-uri --parameters User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586253202342282613?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"status":"Running"}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-05-06T08:27:03.525799Z","duration":"PT11.555305S","correlationId":"dddd5cc0-5559-4940-844e-c7ef5e8994e4","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"b10fd713-f05a-4679-ad4d-fbce0624c701","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Inbound"}},{"name":"AllowAzureLoadBalancerInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from azure load balancer","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"AzureLoadBalancer","destinationAddressPrefix":"*","access":"Allow","priority":65001,"direction":"Inbound"}},{"name":"DenyAllInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + all inbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Inbound"}},{"name":"AllowVnetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Outbound"}},{"name":"AllowInternetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to Internet","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"Internet","access":"Allow","priority":65001,"direction":"Outbound"}},{"name":"DenyAllOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + all outbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Outbound"}}]}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' headers: cache-control: - no-cache content-length: - - '20' + - '5668' content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:25:11 GMT + - Wed, 06 May 2020 08:27:26 GMT expires: - '-1' pragma: @@ -279,28 +287,36 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - group deployment create + - group deployment show Connection: - keep-alive ParameterSetName: - - -g --template-uri --parameters + - -g -n User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586253202342282613?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"status":"Succeeded"}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-05-06T08:27:03.525799Z","duration":"PT11.555305S","correlationId":"dddd5cc0-5559-4940-844e-c7ef5e8994e4","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"b10fd713-f05a-4679-ad4d-fbce0624c701","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Inbound"}},{"name":"AllowAzureLoadBalancerInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from azure load balancer","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"AzureLoadBalancer","destinationAddressPrefix":"*","access":"Allow","priority":65001,"direction":"Inbound"}},{"name":"DenyAllInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + all inbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Inbound"}},{"name":"AllowVnetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Outbound"}},{"name":"AllowInternetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to Internet","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"Internet","access":"Allow","priority":65001,"direction":"Outbound"}},{"name":"DenyAllOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + all outbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Outbound"}}]}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' headers: cache-control: - no-cache content-length: - - '22' + - '5668' content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:25:41 GMT + - Wed, 06 May 2020 08:27:30 GMT expires: - '-1' pragma: @@ -322,34 +338,155 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - group deployment create + - group deployment delete Connection: - keep-alive + Content-Length: + - '0' ParameterSetName: - - -g --template-uri --parameters + - -g -n User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 - method: GET + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-12-14T01:25:17.8753565Z","duration":"PT1M6.6259963S","correlationId":"c0f08121-ed54-4721-9e9b-a14c7085a2b2","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"2c4dd550-cc23-4080-9790-add4931bedbd","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - inbound traffic from all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Inbound"}},{"name":"AllowAzureLoadBalancerInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - inbound traffic from azure load balancer","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"AzureLoadBalancer","destinationAddressPrefix":"*","access":"Allow","priority":65001,"direction":"Inbound"}},{"name":"DenyAllInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny - all inbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Inbound"}},{"name":"AllowVnetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - outbound traffic from all VMs to all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Outbound"}},{"name":"AllowInternetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - outbound traffic from all VMs to Internet","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"Internet","access":"Allow","priority":65001,"direction":"Outbound"}},{"name":"DenyAllOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny - all outbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Outbound"}}]}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 06 May 2020 08:27:34 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group deployment delete + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 06 May 2020 08:27:52 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group deployment delete + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Wed, 06 May 2020 08:28:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group deployment list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/?api-version=2019-07-01 + response: + body: + string: '{"value":[]}' headers: cache-control: - no-cache content-length: - - '5671' + - '12' content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:25:41 GMT + - Wed, 06 May 2020 08:28:14 GMT expires: - '-1' pragma: @@ -365,42 +502,271 @@ interactions: message: OK - request: body: null + headers: + Connection: + - close + Host: + - raw.githubusercontent.com + User-Agent: + - 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/simple_deploy.json + response: + body: + string: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {\n \"location\": + {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\",\n + \ \"metadata\": {\n \"description\": \"Location for the network + security group.\"\n }\n },\n \"name\": {\n \"type\": \"string\",\n + \ \"metadata\": {\n \"description\": \"Name of the network security + group.\"\n }\n }\n },\n \"variables\": {\n },\n \"resources\": + [\n {\n \"type\": \"Microsoft.Network/networkSecurityGroups\",\n \"name\": + \"[parameters('name')]\",\n \"apiVersion\": \"2015-06-15\",\n \"location\": + \"[parameters('location')]\",\n \"properties\": {\n \"securityRules\": + [\n ]\n },\n \"dependsOn\": [ ]\n }\n ],\n \"outputs\": + {\n \"NewNSG\": {\n /** comment1\n comment2\n comment3\n + \ **/\n // comment\n /** comment **/\n \"type\": \"object\", + /** comment **/\n \"value\": \"[reference(parameters('name'))]\" // comment\n + \ // comment\n /** comment **/\n /** comment1\n comment2\n + \ comment3\n **/\n }\n } // comment\n}\n" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - close + content-length: + - '1168' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Wed, 06 May 2020 08:28:33 GMT + etag: + - W/"997394d4fe7eedc3fef1deb4f9b203ec0ad6f2de1061196b567e3c602c008915" + expires: + - Wed, 06 May 2020 08:33:33 GMT + source-age: + - '107' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding + via: + - 1.1 varnish (Varnish/6.0) + - 1.1 varnish + x-cache: + - MISS, HIT + x-cache-hits: + - 0, 1 + x-content-type-options: + - nosniff + x-fastly-request-id: + - 3a1b4e087aa6be681d0e4e1e63a8e9bd3411f5fa + x-frame-options: + - deny + x-github-request-id: + - D7A6:163A:20D7DD:272078:5EB274C6 + x-served-by: + - cache-hkg17926-HKG + x-timer: + - S1588753714.795105,VS0,VE0 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"properties": {"templateLink": {"uri": "https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json"}, + "parameters": {"location": {"value": "westus"}, "name": {"value": "azure-cli-deploy-test-nsg1"}}, + "mode": "Incremental"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - group deployment show + - deployment group create Connection: - keep-alive + Content-Length: + - '300' + Content-Type: + - application/json; charset=utf-8 ParameterSetName: - - -g -n + - -g --template-uri --parameters + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/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_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-05-06T08:28:36.9033833Z","duration":"PT0S","correlationId":"94f8d4b3-781f-4e5c-bf8c-3362abc36cf2","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1203' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 08:28:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"templateLink": {"uri": "https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json"}, + "parameters": {"location": {"value": "westus"}, "name": {"value": "azure-cli-deploy-test-nsg1"}}, + "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group create + Connection: + - keep-alive + Content-Length: + - '300' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --template-uri --parameters User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 accept-language: - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-05-06T08:28:42.6521243Z","duration":"PT2.043371S","correlationId":"b65ff009-9f60-4e2c-b5b0-b4815d2303b3","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy/operationStatuses/08586128531648688622?api-version=2019-07-01 + cache-control: + - no-cache + content-length: + - '957' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 08:28:43 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group create + Connection: + - keep-alive + ParameterSetName: + - -g --template-uri --parameters + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586128531648688622?api-version=2019-07-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 08:29:14 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group create + Connection: + - keep-alive + ParameterSetName: + - -g --template-uri --parameters + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2019-12-14T01:25:17.8753565Z","duration":"PT1M6.6259963S","correlationId":"c0f08121-ed54-4721-9e9b-a14c7085a2b2","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"2c4dd550-cc23-4080-9790-add4931bedbd","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - inbound traffic from all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Inbound"}},{"name":"AllowAzureLoadBalancerInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - inbound traffic from azure load balancer","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"AzureLoadBalancer","destinationAddressPrefix":"*","access":"Allow","priority":65001,"direction":"Inbound"}},{"name":"DenyAllInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny - all inbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Inbound"}},{"name":"AllowVnetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - outbound traffic from all VMs to all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Outbound"}},{"name":"AllowInternetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow - outbound traffic from all VMs to Internet","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"Internet","access":"Allow","priority":65001,"direction":"Outbound"}},{"name":"DenyAllOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"88a5c9c2-be68-4dc6-a3c8-e4866c6da1be\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-05-06T08:28:48.0482349Z","duration":"PT7.4394816S","correlationId":"b65ff009-9f60-4e2c-b5b0-b4815d2303b3","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"b10fd713-f05a-4679-ad4d-fbce0624c701","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Inbound"}},{"name":"AllowAzureLoadBalancerInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from azure load balancer","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"AzureLoadBalancer","destinationAddressPrefix":"*","access":"Allow","priority":65001,"direction":"Inbound"}},{"name":"DenyAllInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + all inbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Inbound"}},{"name":"AllowVnetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Outbound"}},{"name":"AllowInternetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to Internet","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"Internet","access":"Allow","priority":65001,"direction":"Outbound"}},{"name":"DenyAllOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny all outbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Outbound"}}]}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' headers: cache-control: - no-cache content-length: - - '5671' + - '5669' content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:25:42 GMT + - Wed, 06 May 2020 08:29:16 GMT expires: - '-1' pragma: @@ -422,45 +788,49 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - group deployment delete + - deployment group show Connection: - keep-alive - Content-Length: - - '0' ParameterSetName: - -g -n User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 accept-language: - en-US - method: DELETE + method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: - string: '' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/simple_deploy","name":"simple_deploy","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"uri":"https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/simple_deploy.json","contentVersion":"1.0.0.0"},"templateHash":"18214098974183646216","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-05-06T08:28:48.0482349Z","duration":"PT7.4394816S","correlationId":"b65ff009-9f60-4e2c-b5b0-b4815d2303b3","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"b10fd713-f05a-4679-ad4d-fbce0624c701","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Inbound"}},{"name":"AllowAzureLoadBalancerInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + inbound traffic from azure load balancer","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"AzureLoadBalancer","destinationAddressPrefix":"*","access":"Allow","priority":65001,"direction":"Inbound"}},{"name":"DenyAllInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + all inbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Inbound"}},{"name":"AllowVnetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to all VMs in VNET","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"VirtualNetwork","destinationAddressPrefix":"VirtualNetwork","access":"Allow","priority":65000,"direction":"Outbound"}},{"name":"AllowInternetOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Allow + outbound traffic from all VMs to Internet","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"Internet","access":"Allow","priority":65001,"direction":"Outbound"}},{"name":"DenyAllOutBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"c8b72caa-fce3-4304-bc55-93377cec2cce\"","type":"Microsoft.Network/networkSecurityGroups/defaultSecurityRules","properties":{"provisioningState":"Succeeded","description":"Deny + all outbound traffic","protocol":"*","sourcePortRange":"*","destinationPortRange":"*","sourceAddressPrefix":"*","destinationAddressPrefix":"*","access":"Deny","priority":65500,"direction":"Outbound"}}]}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_uri000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' headers: cache-control: - no-cache content-length: - - '0' + - '5669' + content-type: + - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:25:43 GMT + - Wed, 06 May 2020 08:29:23 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklVUFhLR0NLSFI2TExSSEs0WE58OThDOTdBMDBFRjM3NzJERi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: @@ -469,16 +839,20 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - group deployment delete + - deployment group delete Connection: - keep-alive + Content-Length: + - '0' ParameterSetName: - -g -n User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklVUFhLR0NLSFI2TExSSEs0WE58OThDOTdBMDBFRjM3NzJERi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_uri000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2019-07-01 response: body: string: '' @@ -488,17 +862,19 @@ interactions: content-length: - '0' date: - - Sat, 14 Dec 2019 01:25:58 GMT + - Wed, 06 May 2020 08:29:32 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklVUFhLR0NLSFI2TExSSEs0WE58OThDOTdBMDBFRjM3NzJERi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' status: code: 202 message: Accepted @@ -510,16 +886,16 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - group deployment delete + - deployment group delete Connection: - keep-alive ParameterSetName: - -g -n User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklVUFhLR0NLSFI2TExSSEs0WE58OThDOTdBMDBFRjM3NzJERi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 response: body: string: '' @@ -529,11 +905,11 @@ interactions: content-length: - '0' date: - - Sat, 14 Dec 2019 01:26:13 GMT + - Wed, 06 May 2020 08:29:50 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklVUFhLR0NLSFI2TExSSEs0WE58OThDOTdBMDBFRjM3NzJERi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 pragma: - no-cache strict-transport-security: @@ -551,16 +927,16 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - group deployment delete + - deployment group delete Connection: - keep-alive ParameterSetName: - -g -n User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklVUFhLR0NLSFI2TExSSEs0WE58OThDOTdBMDBFRjM3NzJERi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZVUklRUlJaNUNUWU9JUUNCRlQ1WlR8NTkwOTJERjU0MDVFREU3Mi1TSU1QTEU6NUZERVBMT1ktIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2019-07-01 response: body: string: '' @@ -568,7 +944,7 @@ interactions: cache-control: - no-cache date: - - Sat, 14 Dec 2019 01:26:28 GMT + - Wed, 06 May 2020 08:30:06 GMT expires: - '-1' pragma: @@ -588,14 +964,14 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - group deployment list + - deployment group list Connection: - keep-alive ParameterSetName: - -g User-Agent: - - python/3.6.5 (Windows-10-10.0.17134-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.77 + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 accept-language: - en-US method: GET @@ -611,7 +987,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Sat, 14 Dec 2019 01:26:28 GMT + - Wed, 06 May 2020 08:30:12 GMT expires: - '-1' pragma: 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 77396d0e3e0..825e8a5b43a 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 @@ -940,6 +940,7 @@ def test_group_deployment_thru_uri(self, resource_group): self.kwargs['dn'] = self.cmd('group deployment create -g {rg} --template-uri {tf} --parameters @{params}', checks=[ self.check('properties.provisioningState', 'Succeeded'), self.check('resourceGroup', '{rg}'), + self.check('properties.templateLink.uri', '{tf}'), ]).get_output_in_json()['name'] self.cmd('group deployment show -g {rg} -n {dn}', @@ -949,6 +950,19 @@ def test_group_deployment_thru_uri(self, resource_group): self.cmd('group deployment list -g {rg}', checks=self.is_empty()) + self.kwargs['dn'] = self.cmd('deployment group create -g {rg} --template-uri {tf} --parameters @{params}', checks=[ + self.check('properties.provisioningState', 'Succeeded'), + self.check('resourceGroup', '{rg}'), + self.check('properties.templateLink.uri', '{tf}'), + ]).get_output_in_json()['name'] + + self.cmd('deployment group show -g {rg} -n {dn}', + checks=self.check('name', '{dn}')) + + self.cmd('deployment group delete -g {rg} -n {dn}') + self.cmd('deployment group list -g {rg}', + checks=self.is_empty()) + class DeploymentWhatIfAtResourceGroupScopeTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_deployment_what_if')