diff --git a/src/azure-cli-core/azure/cli/core/profiles/_shared.py b/src/azure-cli-core/azure/cli/core/profiles/_shared.py index 9ee2baad4e9..86d1c1a5723 100644 --- a/src/azure-cli-core/azure/cli/core/profiles/_shared.py +++ b/src/azure-cli-core/azure/cli/core/profiles/_shared.py @@ -48,6 +48,7 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods MGMT_RESOURCE_RESOURCES = ('azure.mgmt.resource.resources', 'ResourceManagementClient') MGMT_RESOURCE_SUBSCRIPTIONS = ('azure.mgmt.resource.subscriptions', 'SubscriptionClient') MGMT_RESOURCE_DEPLOYMENTSCRIPTS = ('azure.mgmt.resource.deploymentscripts', 'DeploymentScriptsClient') + MGMT_RESOURCE_TEMPLATESPECS = ('azure.mgmt.resource.templatespecs', 'TemplateSpecsClient') MGMT_MONITOR = ('azure.mgmt.monitor', 'MonitorManagementClient') DATA_KEYVAULT = ('azure.keyvault', 'KeyVaultClient') DATA_PRIVATE_KEYVAULT = ('azure.cli.command_modules.keyvault.vendored_sdks.azure_keyvault_t1', 'KeyVaultClient') @@ -153,6 +154,7 @@ def default_api_version(self): ResourceType.MGMT_RESOURCE_RESOURCES: '2020-06-01', ResourceType.MGMT_RESOURCE_SUBSCRIPTIONS: '2019-11-01', ResourceType.MGMT_RESOURCE_DEPLOYMENTSCRIPTS: '2019-10-01-preview', + ResourceType.MGMT_RESOURCE_TEMPLATESPECS: '2019-06-01-preview', ResourceType.MGMT_NETWORK_DNS: '2018-05-01', ResourceType.MGMT_KEYVAULT: '2020-04-01-preview', ResourceType.MGMT_AUTHORIZATION: SDKProfile('2020-04-01-preview', { @@ -221,6 +223,7 @@ def default_api_version(self): ResourceType.MGMT_RESOURCE_POLICY: '2016-12-01', ResourceType.MGMT_RESOURCE_RESOURCES: '2018-05-01', ResourceType.MGMT_RESOURCE_SUBSCRIPTIONS: '2016-06-01', + ResourceType.MGMT_RESOURCE_TEMPLATESPECS: '2015-01-01', ResourceType.MGMT_NETWORK_DNS: '2016-04-01', ResourceType.MGMT_KEYVAULT: '2016-10-01', ResourceType.MGMT_AUTHORIZATION: SDKProfile('2015-07-01', { @@ -251,6 +254,7 @@ def default_api_version(self): ResourceType.MGMT_RESOURCE_POLICY: '2016-12-01', ResourceType.MGMT_RESOURCE_RESOURCES: '2018-02-01', ResourceType.MGMT_RESOURCE_SUBSCRIPTIONS: '2016-06-01', + ResourceType.MGMT_RESOURCE_TEMPLATESPECS: '2015-01-01', ResourceType.MGMT_NETWORK_DNS: '2016-04-01', ResourceType.MGMT_KEYVAULT: '2016-10-01', ResourceType.MGMT_AUTHORIZATION: SDKProfile('2015-07-01', { @@ -273,6 +277,7 @@ def default_api_version(self): ResourceType.MGMT_RESOURCE_POLICY: '2015-10-01-preview', ResourceType.MGMT_RESOURCE_RESOURCES: '2016-02-01', ResourceType.MGMT_RESOURCE_SUBSCRIPTIONS: '2016-06-01', + ResourceType.MGMT_RESOURCE_TEMPLATESPECS: '2015-01-01', ResourceType.MGMT_NETWORK_DNS: '2016-04-01', ResourceType.MGMT_KEYVAULT: '2016-10-01', ResourceType.MGMT_AUTHORIZATION: SDKProfile('2015-07-01', { diff --git a/src/azure-cli/azure/cli/command_modules/resource/_client_factory.py b/src/azure-cli/azure/cli/command_modules/resource/_client_factory.py index e2c01e15aa0..1ac97bf446c 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/resource/_client_factory.py @@ -58,6 +58,12 @@ def _resource_managementgroups_client_factory(cli_ctx, **_): return get_mgmt_service_client(cli_ctx, ManagementGroupsAPI, subscription_bound=False) +def _resource_templatespecs_client_factory(cli_ctx, **_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azure.cli.core.profiles import ResourceType + return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS) + + def cf_resource_groups(cli_ctx, _): return _resource_client_factory(cli_ctx).resource_groups @@ -120,3 +126,7 @@ def cf_management_groups(cli_ctx, _): def cf_management_group_subscriptions(cli_ctx, _): return _resource_managementgroups_client_factory(cli_ctx).management_group_subscriptions + + +def cf_resource_templatespecs(cli_ctx, _): + return _resource_templatespecs_client_factory(cli_ctx).template_specs diff --git a/src/azure-cli/azure/cli/command_modules/resource/_help.py b/src/azure-cli/azure/cli/command_modules/resource/_help.py index 36e9668edf2..c49dcbcfe95 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/_help.py +++ b/src/azure-cli/azure/cli/command_modules/resource/_help.py @@ -256,6 +256,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --location -l short-summary: The location to store the deployment metadata. - name: --name -n @@ -279,6 +281,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --location -l short-summary: The location to store the deployment metadata. - name: --name -n @@ -297,6 +301,9 @@ text: > az deployment create --location WestUS --template-file azuredeploy.json \\ --parameters @params.json --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json + - name: Create a deployment at subscription scope from a template-spec + text: > + az deployment create --location WestUS --template-spec "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Resources/templateSpecs/myTemplateSpec/versions/1.0" """ helps['deployment export'] = """ @@ -388,6 +395,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --location -l short-summary: The location to store the deployment metadata. - name: --name -n @@ -414,6 +423,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --location -l short-summary: The location to store the deployment metadata. - name: --name -n @@ -448,6 +459,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --location -l short-summary: The location to store the deployment What-If operation metadata. - name: --name -n @@ -549,6 +562,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --resource-group -g short-summary: The resource group to create deployment at. - name: --name -n @@ -577,6 +592,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --resource-group -g short-summary: The resource group to create deployment at. - name: --name -n @@ -603,6 +620,9 @@ az deployment group create --resource-group testrg --name rollout01 \\ --template-file azuredeploy.json --parameters @params.json \\ --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json + - name: Create a deployment at subscription scope from a template-spec + text: > + az deployment group create --resource-group testrg --template-spec "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Resources/templateSpecs/myTemplateSpec/versions/1.0" """ helps['deployment group what-if'] = """ @@ -618,6 +638,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --resource-group -g short-summary: The resource group to execute deployment What-If operation at. - name: --name -n @@ -726,6 +748,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --management-group-id -m short-summary: The management group id to create deployment at. - name: --name -n @@ -750,6 +774,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --management-group-id -m short-summary: The management group id to create deployment at. - name: --name -n @@ -783,6 +809,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --management-group-id -m short-summary: The management group id to create deployment at. - name: --name -n @@ -886,6 +914,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --name -n short-summary: The deployment name. - name: --location -l @@ -908,6 +938,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --location -l short-summary: The location to store the deployment What-If operation metadata. - name: --name -n @@ -939,6 +971,8 @@ short-summary: The path to the template file. - name: --template-uri -u short-summary: The URI to the template file. + - name: --template-spec -s + short-summary: The template spec resource id. - name: --name -n short-summary: The deployment name. - name: --location -l @@ -2156,3 +2190,84 @@ text: > az tag update --resource-id /subscriptions/{sub-id}/resourcegroups/{rg}/providers/Microsoft.Compute/virtualMachines/{vmName} --operation delete --tags key1=value1 """ + +helps['ts'] = """ +type: group +short-summary: Manage template specs at subscription or resource group scope. +""" + +helps['ts create'] = """ +type: command +short-summary: Create a template spec and or template spec version. +examples: + - name: Create a template spec. + text: az ts create -g testRG --name TemplateSpecName -l WestUS --display-name "MyDisplayName" --description "Simple template spec" + - name: Create a template spec version. + text: az ts create -g testRG --name TemplateSpecName -v 2.0 -l WestUS --template-file templateSpec.json --version-description "Less simple template spec" + - name: Create a template spec and a version of the template spec. + text: az ts create -g testRG --name TemplateSpecName -v 1.0 -l WestUS --template-file templateSpec.json --display-name "MyDisplayName" --description "Simple template spec" --version-description "Version of simple template spec" +""" + +helps['ts update'] = """ +type: command +short-summary: Update a template spec version. +examples: + - name: Update the template content of a template spec or template spec version based on the resource ID. + text: az ts update --template-spec resourceID -f updatedFile.json + - name: Update the display name of a template spec based on the resource ID. + text: az ts update --template-spec resourceID --display-name "NewParentDisplayName" + - name: Update the description of a template spec version. + text: az ts update -g ExistingRG --name ExistingName -v 3.0 --version-description "New description" + - name: Update all the properties of a template spec version. + text: az ts update -g ExistingRG --name ExistingName -v 3.0 -f updatedTemplate.json --display-name "New parent display name" --description "New parent description" --version-description "New child description" +""" + +helps['ts show'] = """ +type: command +short-summary: Get the specified template spec or template spec version. +examples: + - name: Show the specified template spec. + text: az ts show -g testrg --name TemplateSpecName + - name: Show the specified template spec version. + text: az ts show -g testrg --name TemplateSpecName --version VersionName + - name: Show the specified template spec or template spec version based on the resource ID. + text: az ts show --template-spec resourceID +""" + +helps['ts export'] = """ +type: command +short-summary: Export the specified template spec and artifacts (if any) to the specified output folder. +examples: + - name: Export the specified template spec with all versions. + text: az ts export -g testrg --name TemplateSpecName --output-folder C:/path/ + - name: Export the specified template spec. + text: az ts export -s resourceID --output-folder C:/path/ + - name: Export the specified template spec version. + text: az ts export -g testrg --name TemplateSpecName --version VersionName --output-folder C:/path/ +""" + +helps['ts delete'] = """ +type: command +short-summary: Delete a specified template spec or template spec version by name or resource ID.. +examples: + - name: Delete the specified template spec and all versions. + text: az ts delete -g MyResourceGroup --name TemplateSpecName + - name: Delete the specified version from the template spec. + text: az ts delete -g MyResourceGroup --name TemplateSpecName --version VersionName + - name: Delete the template spec or version based on resource ID. + text: az ts delete --template-spec resourceID +""" + +helps['ts list'] = """ +type: command +short-summary: List template specs or template spec versions. +examples: + - name: List all template specs in current default subscription. + text: az ts list + - name: List all template specs in specified subscription. + text: az ts list --subscription Subscription + - name: List all template specs in resource group. + text: az ts list -g MyResourceGroup + - name: List all versions of parent template spec. + text: az ts list -g MyResourceGroup -n TemplateSpecName +""" diff --git a/src/azure-cli/azure/cli/command_modules/resource/_packing_engine.py b/src/azure-cli/azure/cli/command_modules/resource/_packing_engine.py new file mode 100644 index 00000000000..e6ff89d1c2a --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/_packing_engine.py @@ -0,0 +1,202 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import os +import json +from knack.util import CLIError +from azure.cli.core.util import read_file_content +from azure.cli.command_modules.resource.custom import _remove_comments_from_json +from azure.cli.core.profiles import ResourceType, get_sdk + + +class PackagedTemplate(): # pylint: disable=too-few-public-methods + def __init__(self, template, artifacts): + self.RootTemplate = template + self.Artifacts = artifacts + + +class PackingContext(): # pylint: disable=too-few-public-methods + def __init__(self, root_template_directory): + self.RootTemplateDirectory = os.path.abspath(root_template_directory) + self.CurrentDirectory = os.path.abspath(root_template_directory) + self.Artifact = [] + + +def pack(cmd, template_file): + """ + Packs the specified template and its referenced artifacts for use in a Template Spec. + :param template_file: The path to the template spec .json file. + :type name: str + """ + root_template_file_path = os.path.abspath(template_file) + context = PackingContext(os.path.dirname(root_template_file_path)) + template_content = read_file_content(template_file) + sanitized_template = _remove_comments_from_json(template_content) + template_json = json.loads(json.dumps(sanitized_template)) + _pack_artifacts(cmd, root_template_file_path, context) + return PackagedTemplate(template_json, getattr(context, 'Artifact')) + + +def _pack_artifacts(cmd, template_abs_file_path, context): + """ + Recursively packs the specified template and its referenced artifacts and + adds the artifacts to the current packing context. + + :param template_abs_file_path: The path to the template spec .json file to pack. + :type template_abs_file_path : str + :param context : The packing context of the current packing operation + :type content : PackingContext + :param artifactableTemplateObj : The packagable template object + :type artifactableTemplateObj : JSON + """ + original_directory = getattr(context, 'CurrentDirectory') + try: + context.CurrentDirectory = os.path.dirname(template_abs_file_path) + template_content = read_file_content(template_abs_file_path) + artifactable_template_obj = sanitized_template = _remove_comments_from_json(template_content) + template_json = json.loads(json.dumps(sanitized_template)) + template_link_to_artifact_objs = _get_template_links_to_artifacts(cmd, artifactable_template_obj, + includeNested=True) + + for template_link_obj in template_link_to_artifact_objs: + relative_path = str(template_link_obj['relativePath']) + if not relative_path: + continue + # This is a templateLink to a local template... Get the absolute path of the + # template based on its relative path from the current template directory and + # make sure it exists: + + abs_local_path = os.path.join(getattr(context, 'CurrentDirectory'), relative_path) + if not os.path.isfile(abs_local_path): + raise CLIError('File ' + abs_local_path + 'not found.') + + # Let's make sure we're not referencing a file outside of our root directory + # hierarchy. We won't allow such references for security purposes: + + if(not os.path.commonpath([getattr(context, 'RootTemplateDirectory')]) == + os.path.commonpath([getattr(context, 'RootTemplateDirectory'), abs_local_path])): + raise CLIError('Unable to handle the reference to file ' + abs_local_path + 'from ' + + template_abs_file_path + 'because it exists outside of the root template directory of ' + + getattr(context, 'RootTemplateDirectory')) + + # Convert the template relative path to one that is relative to our root + # directory path, and then if we haven't already processed that template into + # an artifact elsewhere, we'll do so here... + + as_relative_path = _absolute_to_relative_path(getattr(context, 'RootTemplateDirectory'), abs_local_path) + for prev_added_artifact in getattr(context, 'Artifact'): + prev_added_artifact = os.path.join(getattr(context, 'RootTemplateDirectory'), + getattr(prev_added_artifact, 'path')) + if os.path.samefile(prev_added_artifact, abs_local_path): + continue + _pack_artifacts(cmd, abs_local_path, context) + TemplateSpecTemplateArtifact = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS, + 'TemplateSpecTemplateArtifact', mod='models') + template_content = read_file_content(abs_local_path) + sanitized_template = _remove_comments_from_json(template_content) + template_json = json.loads(json.dumps(sanitized_template)) + artifact = TemplateSpecTemplateArtifact(path=as_relative_path, template=template_json) + context.Artifact.append(artifact) + finally: + context.CurrentDirectory = original_directory + + +def _get_deployment_resource_objects(cmd, template_obj, includeNested=False): + immediate_deployment_resources = [] + + if 'resources' in template_obj: + resources = template_obj['resources'] + for resource in resources: + if (str(resource['type']) == 'Microsoft.Resources/deployments') is True: + immediate_deployment_resources.append(resource) + results = [] + for deployment_resource_obj in immediate_deployment_resources: + results.append(deployment_resource_obj) + if(includeNested and 'properties' in deployment_resource_obj): + deployment_resource_props_obj = deployment_resource_obj['properties'] + if 'template' in deployment_resource_props_obj: + results.extend(_get_deployment_resource_objects(cmd, + deployment_resource_props_obj['template'], + includeNested=True)) + return results + + +def _get_template_links_to_artifacts(cmd, template_obj, includeNested=False): + deployment_resource_objs = _get_deployment_resource_objects(cmd, template_obj, includeNested) + template_link_objs = [] + # TODO: Verify JSON Objects + for obj in deployment_resource_objs: + if 'properties' in obj: + props_obj = obj['properties'] + if 'templateLink' in props_obj: + template_link_obj = props_obj['templateLink'] + if 'relativePath' in template_link_obj: + template_link_objs.append(template_link_obj) + return template_link_objs + + +def _normalize_directory_seperators_for_local_file_system(abs_file_path): + """ + Simply normalizes directory path separators in the specified path + to match those of the local filesystem(s). + """ + # Windows based: + if os.sep == '\\': + return str(abs_file_path).replace(os.altsep, '\\') + # Unit/Other based: + return str(abs_file_path).replace('\\', os.sep) + + +def _absolute_to_relative_path(root_dir_path, abs_file_path): + root_dir_path = root_dir_path.rstrip(os.sep).rstrip(os.altsep) + # Ensure we have a trailing seperator + root_dir_path += os.sep + # AbsolutePath ensures paths are normalized + + file_path = os.path.abspath(abs_file_path) + root_path = os.path.abspath(root_dir_path) + relative_path = str(os.path.relpath(file_path, root_path)).replace('/', os.sep) + return relative_path + + +def unpack(cmd, exported_template, target_dir, template_file_name): + + packaged_template = PackagedTemplate(exported_template.template, exported_template.artifacts) + # Ensure paths are normalized: + template_file_name = os.path.basename(template_file_name) + target_dir = os.path.abspath(target_dir).rstrip(os.sep).rstrip(os.altsep) + root_template_file_path = os.path.join(target_dir, template_file_name) + + # TODO: Directory/file existence checks.. + # Go through each artifact ad make sure it's not going to place artifacts + # outside of the target directory: + + for artifact in getattr(packaged_template, 'Artifacts'): + local_path = os.path.join(target_dir, + _normalize_directory_seperators_for_local_file_system(getattr(artifact, 'path'))) + abs_local_path = os.path.abspath(local_path) + if os.path.commonpath([target_dir]) != os.path.commonpath([target_dir, abs_local_path]): + raise CLIError('Unable to unpack artifact ' + getattr(artifact, 'path') + 'because it would create a file' + + 'outside of the target directory hierarchy of' + target_dir) + + # Now that the artifact paths checkout...let's begin by writing our main template + # file and then processing each artifact: + + if not os.path.exists(target_dir): + os.makedirs(os.path.dirname(target_dir)) + with open(root_template_file_path, 'w') as root_file: + json.dump(getattr(packaged_template, 'RootTemplate'), root_file, indent=2) + + TemplateSpecTemplateArtifact = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS, + 'TemplateSpecTemplateArtifact', mod='models') + for artifact in getattr(packaged_template, 'Artifacts'): + if not isinstance(artifact, TemplateSpecTemplateArtifact): + raise CLIError('Unknown artifact type encountered...') + artifact_path = _normalize_directory_seperators_for_local_file_system(getattr(artifact, 'path')) + abs_local_path = os.path.abspath(os.path.join(target_dir, artifact_path)) + if not os.path.exists(os.path.dirname(abs_local_path)): + os.makedirs(os.path.dirname(abs_local_path)) + with open(abs_local_path, 'w') as artifact_file: + json.dump(getattr(artifact, 'template'), artifact_file, indent=2) + return target_dir diff --git a/src/azure-cli/azure/cli/command_modules/resource/_params.py b/src/azure-cli/azure/cli/command_modules/resource/_params.py index 03e9e5ea447..cc38241ae85 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/_params.py +++ b/src/azure-cli/azure/cli/command_modules/resource/_params.py @@ -50,6 +50,7 @@ def load_arguments(self, _): deployment_template_file_type = CLIArgumentType(options_list=['--template-file', '-f'], completer=FilesCompleter(), type=file_type, help="a template file path in the file system") deployment_template_uri_type = CLIArgumentType(options_list=['--template-uri', '-u'], help='a uri to a remote template file') + deployment_template_spec_type = CLIArgumentType(options_list=['--template-spec', '-s'], is_preview=True, min_api='2019-06-01', help="The template spec resource id.") deployment_parameters_type = CLIArgumentType(options_list=['--parameters', '-p'], action='append', nargs='+', completer=FilesCompleter(), help='the deployment parameters') filter_type = CLIArgumentType(options_list=['--filter'], is_preview=True, help='Filter expression using OData notation. You can use --filter "provisioningState eq \'{state}\'" to filter provisioningState. ' @@ -81,6 +82,10 @@ def load_arguments(self, _): 'For example, if the supported api-version of resource provider is 2020-01-01-preview and 2019-01-01: ' 'when passing in this parameter it will take the latest version 2020-01-01-preview, otherwise it will take the latest stable version 2019-01-01 without passing in this parameter') + ts_display_name_type = CLIArgumentType(options_list=['--display-name', '-d'], help='The display name of the template spec') + ts_description_type = CLIArgumentType(options_list=['--description'], help='The description of the parent template spec.') + ts_version_description_type = CLIArgumentType(options_list=['--version-description'], help='The description of the template spec version.') + _PROVIDER_HELP_TEXT = 'the resource namespace, aka \'provider\'' with self.argument_context('resource') as c: @@ -255,6 +260,7 @@ def load_arguments(self, _): c.argument('deployment_location', arg_type=get_location_type(self.cli_ctx), required=True) c.argument('template_file', arg_type=deployment_template_file_type) c.argument('template_uri', arg_type=deployment_template_uri_type) + c.argument('template_spec', arg_type=deployment_template_spec_type) c.argument('parameters', arg_type=deployment_parameters_type) with self.argument_context('deployment create') as c: @@ -522,3 +528,37 @@ def load_arguments(self, _): with self.argument_context('account management-group update') as c: c.argument('display_name', options_list=['--display-name', '-d']) c.argument('parent_id', options_list=['--parent', '-p']) + + with self.argument_context('ts') as c: + c.argument('name', options_list=['--name', '-n'], help='The name of the template spec.') + c.argument('version', options_list=['--version', '-v'], help='The template spec version.') + + with self.argument_context('ts create') as c: + c.argument('resource_group', arg_type=resource_group_name_type, help='The resource group to store the template spec.') + c.argument('template_file', arg_type=deployment_template_file_type) + c.argument('location', options_list=['--location', '-l'], help='The location to store the template-spec and template-spec version(s). Cannot be changed after creation.') + c.argument('display_name', arg_type=ts_display_name_type) + c.argument('description', arg_type=ts_description_type) + c.argument('version_description', arg_type=ts_version_description_type) + + with self.argument_context('ts update') as c: + c.argument('resource_group', arg_type=resource_group_name_type, help='The resource group to store the template spec.') + c.argument('template_spec', arg_type=deployment_template_spec_type) + c.argument('template_file', arg_type=deployment_template_file_type) + c.argument('display_name', arg_type=ts_display_name_type) + c.argument('description', arg_type=ts_description_type) + c.argument('version_description', arg_type=ts_version_description_type) + + with self.argument_context('ts show') as c: + c.argument('template_spec', arg_type=deployment_template_spec_type) + + with self.argument_context('ts export') as c: + c.argument('output_folder', options_list=['--output-folder'], help='Existing folder to output export(s).') + c.argument('template_spec', arg_type=deployment_template_spec_type) + + with self.argument_context('ts delete') as c: + c.argument('resource_group', arg_type=resource_group_name_type, help='The resource group where the template spec or template spec version is stored.') + c.argument('template_spec', arg_type=deployment_template_spec_type) + + with self.argument_context('ts list') as c: + c.argument('resource_group', arg_type=resource_group_name_type) diff --git a/src/azure-cli/azure/cli/command_modules/resource/_validators.py b/src/azure-cli/azure/cli/command_modules/resource/_validators.py index 41ad219085b..3f55a18c52a 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/_validators.py +++ b/src/azure-cli/azure/cli/command_modules/resource/_validators.py @@ -16,6 +16,52 @@ MSI_LOCAL_ID = '[system]' +def _validate_template_input(namespace): + if namespace.template_file and not os.path.isfile(namespace.template_file): + raise CLIError('Please enter a valid file path') + + +def _validate_template_spec(namespace): + if namespace.template_spec is None: + if (namespace.name is None or namespace.resource_group_name is None): + raise CLIError('incorrect usage: Please enter ' + 'a resource group and resource name or a resource ID for --template-spec') + else: + from azure.mgmt.core.tools import is_valid_resource_id + namespace.template_spec = namespace.template_spec.strip("\"") + if not is_valid_resource_id(namespace.template_spec): + raise CLIError('--template-spec is not a valid resource ID.') + + +def _validate_template_spec_out(namespace): + _validate_template_spec(namespace) + if namespace.output_folder and not os.path.isdir(namespace.output_folder): + raise CLIError('Please enter a valid output folder') + + +def _validate_deployment_name_with_template_specs(namespace): + # If missing,try come out with a name associated with the template name + if namespace.deployment_name is None: + template_filename = None + if namespace.template_file and os.path.isfile(namespace.template_file): + template_filename = namespace.template_file + if namespace.template_uri and urlparse(namespace.template_uri).scheme: + template_filename = urlsplit(namespace.template_uri).path + if namespace.template_spec: + from azure.mgmt.core.tools import parse_resource_id, is_valid_resource_id + namespace.template_spec = namespace.template_spec.strip("\"") + if not is_valid_resource_id(namespace.template_spec): + raise CLIError('--template-spec is not a valid resource ID.') + if namespace.template_spec.__contains__("versions") is False: + raise CLIError('Please enter a valid template spec version ID.') + template_filename = parse_resource_id(namespace.template_spec).get('resource_name') + if template_filename: + template_filename = os.path.basename(template_filename) + namespace.deployment_name = os.path.splitext(template_filename)[0] + else: + namespace.deployment_name = 'deployment1' + + def _validate_deployment_name(namespace): # If missing,try come out with a name associated with the template name if namespace.deployment_name is None: @@ -32,9 +78,19 @@ def _validate_deployment_name(namespace): def process_deployment_create_namespace(namespace): - if bool(namespace.template_uri) == bool(namespace.template_file): - raise CLIError('incorrect usage: --template-file FILE | --template-uri URI') - _validate_deployment_name(namespace) + try: + if [bool(namespace.template_uri), bool(namespace.template_file), + bool(namespace.template_spec)].count(True) != 1: + raise CLIError('incorrect usage: Chose only one of' + ' --template-file FILE | --template-uri URI | --template-spec ID to pass in') + except Exception: # pylint: disable=broad-except + if [bool(namespace.template_uri), bool(namespace.template_file)].count(True) != 1: + raise CLIError('incorrect usage: Chose only one of' + ' --template-file FILE | --template-uri URI') + if(bool(namespace.template_uri) or bool(namespace.template_file)): + _validate_deployment_name(namespace) + else: + _validate_deployment_name_with_template_specs(namespace) def internal_validate_lock_parameters(namespace, resource_group, resource_provider_namespace, diff --git a/src/azure-cli/azure/cli/command_modules/resource/commands.py b/src/azure-cli/azure/cli/command_modules/resource/commands.py index d90e375c7a0..ddd9147a5c5 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/commands.py +++ b/src/azure-cli/azure/cli/command_modules/resource/commands.py @@ -16,8 +16,8 @@ from azure.cli.command_modules.resource._client_factory import ( cf_resource_groups, cf_providers, cf_features, cf_tags, cf_deployments, cf_deployment_operations, cf_policy_definitions, cf_policy_set_definitions, cf_resource_links, - cf_resource_deploymentscripts, cf_resource_managedapplications, cf_resource_managedappdefinitions, cf_management_groups, cf_management_group_subscriptions) -from azure.cli.command_modules.resource._validators import process_deployment_create_namespace + cf_resource_deploymentscripts, cf_resource_managedapplications, cf_resource_managedappdefinitions, cf_management_groups, cf_management_group_subscriptions, cf_resource_templatespecs) +from azure.cli.command_modules.resource._validators import process_deployment_create_namespace, _validate_template_input, _validate_template_spec, _validate_template_spec_out from ._exception_handler import managementgroups_exception_handler @@ -159,6 +159,12 @@ def load_command_table(self, _): exception_handler=managementgroups_exception_handler ) + resource_templatespecs_sdk = CliCommandType( + operations_tmpl='azure.mgmt.resource.templatespecs.operations#ResourceLinksOperations.{}', + client_factory=cf_resource_templatespecs, + resource_type=ResourceType.MGMT_RESOURCE_TEMPLATESPECS + ) + with self.command_group('account lock', resource_lock_sdk, resource_type=ResourceType.MGMT_RESOURCE_LOCKS) as g: g.custom_command('create', 'create_lock') g.custom_command('delete', 'delete_lock') @@ -291,6 +297,14 @@ def load_command_table(self, _): g.custom_command('show-log', 'get_deployment_script_logs') g.custom_command('delete', 'delete_deployment_script', confirmation=True) + with self.command_group('ts', resource_templatespecs_sdk, resource_type=ResourceType.MGMT_RESOURCE_TEMPLATESPECS, is_preview=True, min_api='2019-06-01-preview') as g: + g.custom_command('create', 'create_template_spec', validator=_validate_template_input) + g.custom_command('update', 'update_template_spec', validator=_validate_template_input, confirmation=True) + g.custom_command('export', 'export_template_spec', validator=_validate_template_spec_out) + g.custom_show_command('show', 'get_template_spec', validator=_validate_template_spec) + g.custom_command('list', 'list_template_specs') + g.custom_command('delete', 'delete_template_spec', validator=_validate_template_spec, confirmation=True) + # az deployment group with self.command_group('deployment group', resource_deployment_sdk, resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g: g.custom_command('list', 'list_deployments_at_resource_group', table_transformer=transform_deployments_list) 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 775c001750c..f70911869b0 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/custom.py +++ b/src/azure-cli/azure/cli/command_modules/resource/custom.py @@ -33,7 +33,7 @@ from azure.cli.command_modules.resource._client_factory import ( _resource_client_factory, _resource_policy_client_factory, _resource_lock_client_factory, - _resource_links_client_factory, _resource_deploymentscripts_client_factory, _authorization_management_client, _resource_managedapps_client_factory) + _resource_links_client_factory, _resource_deploymentscripts_client_factory, _authorization_management_client, _resource_managedapps_client_factory, _resource_templatespecs_client_factory) from azure.cli.command_modules.resource._validators import _parse_lock_id from knack.log import get_logger @@ -140,6 +140,7 @@ def _try_parse_key_value_object(template_param_defs, parameters, value): return parameters +# pylint: disable=redefined-outer-name def _find_missing_parameters(parameters, template): if template is None: return {} @@ -236,6 +237,7 @@ def _prompt_for_parameters(missing_parameters, fail_on_no_tty=True): # pylint: return result +# pylint: disable=redefined-outer-name def _get_missing_parameters(parameters, template, prompt_fn, no_prompt=False): missing = _find_missing_parameters(parameters, template) if missing: @@ -265,6 +267,7 @@ def _urlretrieve(url): return req.read() +# pylint: disable=redefined-outer-name def _remove_comments_from_json(template, preserve_order=True, file_path=None): from jsmin import jsmin @@ -411,7 +414,7 @@ def deploy_arm_template_at_subscription_scope(cmd, deployment_name=None, deployment_location=None, no_wait=False, handle_extended_json_format=None, no_prompt=False, confirm_with_what_if=None, what_if_result_format=None, - what_if_exclude_change_types=None): + what_if_exclude_change_types=None, template_spec=None): if confirm_with_what_if: what_if_deploy_arm_template_at_subscription_scope(cmd, template_file=template_file, template_uri=template_uri, @@ -419,7 +422,7 @@ def deploy_arm_template_at_subscription_scope(cmd, deployment_location=deployment_location, result_format=what_if_result_format, exclude_change_types=what_if_exclude_change_types, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) from knack.prompting import prompt_y_n if not prompt_y_n("\nAre you sure you want to execute the deployment?"): @@ -429,7 +432,7 @@ def deploy_arm_template_at_subscription_scope(cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, deployment_name=deployment_name, deployment_location=deployment_location, validate_only=False, no_wait=no_wait, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) # pylint: disable=unused-argument @@ -437,24 +440,25 @@ def validate_arm_template_at_subscription_scope(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, no_wait=False, handle_extended_json_format=None, - no_prompt=False): + no_prompt=False, template_spec=None): return _deploy_arm_template_at_subscription_scope(cmd=cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, deployment_name=deployment_name, deployment_location=deployment_location, validate_only=True, no_wait=no_wait, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec,) def _deploy_arm_template_at_subscription_scope(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, validate_only=False, - no_wait=False, no_prompt=False): - deployment_properties = _prepare_deployment_properties_unmodified(cli_ctx=cmd.cli_ctx, template_file=template_file, + no_wait=False, no_prompt=False, template_spec=None): + deployment_properties = _prepare_deployment_properties_unmodified(cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, mode='Incremental', - no_prompt=no_prompt) + no_prompt=no_prompt, + template_spec=template_spec) - mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None)) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None and template_spec is None)) if cmd.supported_api_version(min_api='2019-10-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES): Deployment = cmd.get_models('Deployment') @@ -484,7 +488,7 @@ def deploy_arm_template_at_resource_group(cmd, no_wait=False, handle_extended_json_format=None, aux_subscriptions=None, aux_tenants=None, no_prompt=False, confirm_with_what_if=None, what_if_result_format=None, - what_if_exclude_change_types=None): + what_if_exclude_change_types=None, template_spec=None): if confirm_with_what_if: what_if_deploy_arm_template_at_resource_group(cmd, resource_group_name=resource_group_name, @@ -492,7 +496,7 @@ def deploy_arm_template_at_resource_group(cmd, parameters=parameters, deployment_name=deployment_name, mode=mode, aux_tenants=aux_tenants, result_format=what_if_result_format, exclude_change_types=what_if_exclude_change_types, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) from knack.prompting import prompt_y_n if not prompt_y_n("\nAre you sure you want to execute the deployment?"): @@ -504,7 +508,7 @@ def deploy_arm_template_at_resource_group(cmd, deployment_name=deployment_name, mode=mode, rollback_on_error=rollback_on_error, validate_only=False, no_wait=no_wait, aux_subscriptions=aux_subscriptions, aux_tenants=aux_tenants, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) # pylint: disable=unused-argument @@ -512,13 +516,13 @@ def validate_arm_template_at_resource_group(cmd, resource_group_name=None, template_file=None, template_uri=None, parameters=None, deployment_name=None, mode=None, rollback_on_error=None, - no_wait=False, handle_extended_json_format=None, no_prompt=False): + no_wait=False, handle_extended_json_format=None, no_prompt=False, template_spec=None): return _deploy_arm_template_at_resource_group(cmd, resource_group_name=resource_group_name, template_file=template_file, template_uri=template_uri, parameters=parameters, deployment_name=deployment_name, mode=mode, rollback_on_error=rollback_on_error, validate_only=True, no_wait=no_wait, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) def _deploy_arm_template_at_resource_group(cmd, @@ -526,15 +530,15 @@ def _deploy_arm_template_at_resource_group(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, mode=None, rollback_on_error=None, validate_only=False, no_wait=False, - aux_subscriptions=None, aux_tenants=None, no_prompt=False): - deployment_properties = _prepare_deployment_properties_unmodified(cli_ctx=cmd.cli_ctx, template_file=template_file, + aux_subscriptions=None, aux_tenants=None, no_prompt=False, template_spec=None): + deployment_properties = _prepare_deployment_properties_unmodified(cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, mode=mode, rollback_on_error=rollback_on_error, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) mgmt_client = _get_deployment_management_client(cmd.cli_ctx, aux_subscriptions=aux_subscriptions, - aux_tenants=aux_tenants, plug_pipeline=(template_uri is None)) + aux_tenants=aux_tenants, plug_pipeline=(template_uri is None and template_spec is None)) if cmd.supported_api_version(min_api='2019-10-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES): Deployment = cmd.get_models('Deployment') @@ -562,7 +566,7 @@ def deploy_arm_template_at_management_group(cmd, deployment_name=None, deployment_location=None, no_wait=False, handle_extended_json_format=None, no_prompt=False, confirm_with_what_if=None, what_if_result_format=None, - what_if_exclude_change_types=None): + what_if_exclude_change_types=None, template_spec=None): if confirm_with_what_if: what_if_deploy_arm_template_at_management_group(cmd, management_group_id=management_group_id, @@ -571,7 +575,7 @@ def deploy_arm_template_at_management_group(cmd, deployment_location=deployment_location, result_format=what_if_result_format, exclude_change_types=what_if_exclude_change_types, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) from knack.prompting import prompt_y_n if not prompt_y_n("\nAre you sure you want to execute the deployment?"): @@ -582,7 +586,7 @@ def deploy_arm_template_at_management_group(cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, deployment_name=deployment_name, deployment_location=deployment_location, validate_only=False, no_wait=no_wait, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) # pylint: disable=unused-argument @@ -591,26 +595,26 @@ def validate_arm_template_at_management_group(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, no_wait=False, handle_extended_json_format=None, - no_prompt=False): + no_prompt=False, template_spec=None): return _deploy_arm_template_at_management_group(cmd=cmd, management_group_id=management_group_id, template_file=template_file, template_uri=template_uri, parameters=parameters, deployment_name=deployment_name, deployment_location=deployment_location, validate_only=True, no_wait=no_wait, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) def _deploy_arm_template_at_management_group(cmd, management_group_id=None, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, validate_only=False, - no_wait=False, no_prompt=False): - deployment_properties = _prepare_deployment_properties_unmodified(cli_ctx=cmd.cli_ctx, template_file=template_file, + no_wait=False, no_prompt=False, template_spec=None): + deployment_properties = _prepare_deployment_properties_unmodified(cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, mode='Incremental', - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) - mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None)) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None and template_spec is None)) if cmd.supported_api_version(min_api='2019-10-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES): ScopedDeployment = cmd.get_models('ScopedDeployment') @@ -640,7 +644,7 @@ def deploy_arm_template_at_tenant_scope(cmd, deployment_name=None, deployment_location=None, no_wait=False, handle_extended_json_format=None, no_prompt=False, confirm_with_what_if=None, what_if_result_format=None, - what_if_exclude_change_types=None): + what_if_exclude_change_types=None, template_spec=None): if confirm_with_what_if: what_if_deploy_arm_template_at_tenant_scope(cmd, template_file=template_file, template_uri=template_uri, @@ -648,7 +652,7 @@ def deploy_arm_template_at_tenant_scope(cmd, deployment_location=deployment_location, result_format=what_if_result_format, exclude_change_types=what_if_exclude_change_types, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) from knack.prompting import prompt_y_n if not prompt_y_n("\nAre you sure you want to execute the deployment?"): @@ -658,31 +662,31 @@ def deploy_arm_template_at_tenant_scope(cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, deployment_name=deployment_name, deployment_location=deployment_location, validate_only=False, no_wait=no_wait, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) # pylint: disable=unused-argument def validate_arm_template_at_tenant_scope(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, - no_wait=False, handle_extended_json_format=None, no_prompt=False): + no_wait=False, handle_extended_json_format=None, no_prompt=False, template_spec=None): return _deploy_arm_template_at_tenant_scope(cmd=cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, deployment_name=deployment_name, deployment_location=deployment_location, validate_only=True, no_wait=no_wait, - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec) def _deploy_arm_template_at_tenant_scope(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, validate_only=False, - no_wait=False, no_prompt=False): - deployment_properties = _prepare_deployment_properties_unmodified(cli_ctx=cmd.cli_ctx, template_file=template_file, + no_wait=False, no_prompt=False, template_spec=None): + deployment_properties = _prepare_deployment_properties_unmodified(cmd, template_file=template_file, template_uri=template_uri, parameters=parameters, mode='Incremental', - no_prompt=no_prompt) + no_prompt=no_prompt, template_spec=template_spec,) - mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None)) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None and template_spec is None)) if cmd.supported_api_version(min_api='2019-10-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES): ScopedDeployment = cmd.get_models('ScopedDeployment') @@ -711,11 +715,11 @@ def what_if_deploy_arm_template_at_resource_group(cmd, resource_group_name, deployment_name=None, mode=DeploymentMode.incremental, aux_tenants=None, result_format=None, no_pretty_print=None, no_prompt=False, - exclude_change_types=None): - what_if_properties = _prepare_deployment_what_if_properties(cmd.cli_ctx, template_file, template_uri, - parameters, mode, result_format, no_prompt) + exclude_change_types=None, template_spec=None): + what_if_properties = _prepare_deployment_what_if_properties(cmd, template_file, template_uri, + parameters, mode, result_format, no_prompt, template_spec) mgmt_client = _get_deployment_management_client(cmd.cli_ctx, aux_tenants=aux_tenants, - plug_pipeline=(template_uri is None)) + plug_pipeline=(template_uri is None and template_spec 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, exclude_change_types) @@ -725,10 +729,10 @@ def what_if_deploy_arm_template_at_subscription_scope(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, result_format=None, no_pretty_print=None, no_prompt=False, - exclude_change_types=None): - 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, plug_pipeline=(template_uri is None)) + exclude_change_types=None, template_spec=None): + what_if_properties = _prepare_deployment_what_if_properties(cmd, template_file, template_uri, parameters, + DeploymentMode.incremental, result_format, no_prompt, template_spec) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None and template_spec 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, exclude_change_types) @@ -738,10 +742,10 @@ def what_if_deploy_arm_template_at_management_group(cmd, management_group_id=Non template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, result_format=None, no_pretty_print=None, no_prompt=False, - exclude_change_types=None): - 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, plug_pipeline=(template_uri is None)) + exclude_change_types=None, template_spec=None): + what_if_properties = _prepare_deployment_what_if_properties(cmd, template_file, template_uri, parameters, + DeploymentMode.incremental, result_format, no_prompt, template_spec=template_spec) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None and template_spec is None)) what_if_poller = mgmt_client.what_if_at_management_group_scope(management_group_id, deployment_name, deployment_location, what_if_properties) @@ -752,10 +756,10 @@ def what_if_deploy_arm_template_at_tenant_scope(cmd, template_file=None, template_uri=None, parameters=None, deployment_name=None, deployment_location=None, result_format=None, no_pretty_print=None, no_prompt=False, - exclude_change_types=None): - 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, plug_pipeline=(template_uri is None)) + exclude_change_types=None, template_spec=None): + what_if_properties = _prepare_deployment_what_if_properties(cmd, template_file, template_uri, parameters, + DeploymentMode.incremental, result_format, no_prompt, template_spec) + mgmt_client = _get_deployment_management_client(cmd.cli_ctx, plug_pipeline=(template_uri is None and template_spec is None)) what_if_poller = mgmt_client.what_if_at_tenant_scope(deployment_name, deployment_location, what_if_properties) return _what_if_deploy_arm_template_core(cmd.cli_ctx, what_if_poller, no_pretty_print, exclude_change_types) @@ -808,8 +812,9 @@ def _build_preflight_error_message(preflight_error): return '\n'.join(err_messages) -def _prepare_deployment_properties_unmodified(cli_ctx, template_file=None, template_uri=None, parameters=None, - mode=None, rollback_on_error=None, no_prompt=False): +def _prepare_deployment_properties_unmodified(cmd, template_file=None, template_uri=None, parameters=None, + mode=None, rollback_on_error=None, no_prompt=False, template_spec=None): + cli_ctx = cmd.cli_ctx DeploymentProperties, TemplateLink, OnErrorDeployment = get_sdk(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, 'DeploymentProperties', 'TemplateLink', 'OnErrorDeployment', mod='models') @@ -820,6 +825,9 @@ def _prepare_deployment_properties_unmodified(cli_ctx, template_file=None, templ if template_uri: template_link = TemplateLink(uri=template_uri) template_obj = _remove_comments_from_json(_urlretrieve(template_uri).decode('utf-8'), file_path=template_uri) + elif template_spec: + template_link = TemplateLink(id=template_spec, mode="Incremental") + template_obj = show_resource(cmd=cmd, resource_ids=[template_spec]).properties['template'] else: template_content = read_file_content(template_file) template_obj = _remove_comments_from_json(template_content, file_path=template_file) @@ -833,23 +841,21 @@ def _prepare_deployment_properties_unmodified(cli_ctx, template_file=None, templ template_obj['resources'] = template_obj.get('resources', []) parameters = _process_parameters(template_param_defs, parameters) or {} parameters = _get_missing_parameters(parameters, template_obj, _prompt_for_parameters, no_prompt) - parameters = json.loads(json.dumps(parameters)) properties = DeploymentProperties(template=template_content, template_link=template_link, parameters=parameters, mode=mode, on_error_deployment=on_error_deployment) - return properties -def _prepare_deployment_what_if_properties(cli_ctx, template_file, template_uri, parameters, - mode, result_format, no_prompt): - DeploymentWhatIfProperties, DeploymentWhatIfSettings = get_sdk(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, +def _prepare_deployment_what_if_properties(cmd, template_file, template_uri, parameters, + mode, result_format, no_prompt, template_spec): + DeploymentWhatIfProperties, DeploymentWhatIfSettings = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, 'DeploymentWhatIfProperties', 'DeploymentWhatIfSettings', mod='models') - deployment_properties = _prepare_deployment_properties_unmodified(cli_ctx, template_file=template_file, template_uri=template_uri, - parameters=parameters, mode=mode, no_prompt=no_prompt) + deployment_properties = _prepare_deployment_properties_unmodified(cmd=cmd, template_file=template_file, template_uri=template_uri, + parameters=parameters, mode=mode, no_prompt=no_prompt, template_spec=template_spec) deployment_what_if_properties = DeploymentWhatIfProperties(template=deployment_properties.template, template_link=deployment_properties.template_link, parameters=deployment_properties.parameters, mode=deployment_properties.mode, what_if_settings=DeploymentWhatIfSettings(result_format=result_format)) @@ -1730,6 +1736,139 @@ def delete_deployment_script(cmd, resource_group_name, name): rcf.deployment_scripts.delete(resource_group_name, name) +def get_template_spec(cmd, resource_group_name=None, name=None, version=None, template_spec=None): + if template_spec: + id_parts = parse_resource_id(template_spec) + resource_group_name = id_parts.get('resource_group') + name = id_parts.get('name') + version = id_parts.get('resource_name') + if version == name: + version = None + rcf = _resource_templatespecs_client_factory(cmd.cli_ctx) + if version: + return rcf.template_spec_versions.get(resource_group_name, name, version) + return rcf.template_specs.get(resource_group_name, name) + + +def create_template_spec(cmd, resource_group_name, name, template_file=None, location=None, display_name=None, + description=None, version=None, version_description=None): + artifacts = None + input_template = None + if location is None: + rcf = _resource_client_factory(cmd.cli_ctx) + location = rcf.resource_groups.get(resource_group_name).location + rcf = _resource_templatespecs_client_factory(cmd.cli_ctx) + + if version: + if template_file: + from azure.cli.command_modules.resource._packing_engine import (pack) + packed_template = pack(cmd, template_file) + input_template = getattr(packed_template, 'RootTemplate') + artifacts = getattr(packed_template, 'Artifacts') + + try: # Check if parent template spec already exists. + rcf.template_specs.get(resource_group_name=resource_group_name, template_spec_name=name) + except Exception: # pylint: disable=broad-except + TemplateSpec = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS, 'TemplateSpec', mod='models') + template_spec_parent = TemplateSpec(location=location, description=description, display_name=display_name, tags=None) + rcf.template_specs.create_or_update(resource_group_name, name, template_spec_parent) + + TemplateSpecVersion = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS, 'TemplateSpecVersion', mod='models') + template_spec_child = TemplateSpecVersion(location=location, artifacts=artifacts, description=version_description, template=input_template, tags=None) + return rcf.template_spec_versions.create_or_update(resource_group_name, name, version, template_spec_child) + + TemplateSpec = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS, 'TemplateSpec', mod='models') + template_spec_parent = TemplateSpec(location=location, description=description, display_name=display_name, tags=None) + return rcf.template_specs.create_or_update(resource_group_name, name, template_spec_parent) + + +def update_template_spec(cmd, resource_group_name=None, name=None, template_spec=None, template_file=None, display_name=None, + description=None, version=None, version_description=None): + rcf = _resource_templatespecs_client_factory(cmd.cli_ctx) + + if template_spec: + id_parts = parse_resource_id(template_spec) + resource_group_name = id_parts.get('resource_group') + name = id_parts.get('name') + version = id_parts.get('resource_name') + if version == name: + version = None + existing_template = None + artifacts = None + + if template_file: + from azure.cli.command_modules.resource._packing_engine import (pack) + packed_template = pack(cmd, template_file) + input_template = getattr(packed_template, 'RootTemplate') + artifacts = getattr(packed_template, 'Artifacts') + + if version: + existing_template = rcf.template_spec_versions.get(resource_group_name=resource_group_name, template_spec_name=name, template_spec_version=version) + + location = getattr(existing_template, 'location') + version_tags = getattr(existing_template, 'tags') + if version_description is None: + version_description = getattr(existing_template, 'description') + if template_file is None: + input_template = getattr(existing_template, 'template') + + TemplateSpecVersion = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS, 'TemplateSpecVersion', mod='models') + + updated_template_spec = TemplateSpecVersion(location=location, artifacts=artifacts, description=version_description, template=input_template, tags=version_tags) + return rcf.template_spec_versions.create_or_update(resource_group_name, name, version, updated_template_spec) + + existing_template = rcf.template_specs.get(resource_group_name=resource_group_name, template_spec_name=name) + + location = getattr(existing_template, 'location') + tags = getattr(existing_template, 'tags') + if display_name is None: + display_name = getattr(existing_template, 'display_name') + if description is None: + description = getattr(existing_template, 'description') + + TemplateSpec = get_sdk(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_TEMPLATESPECS, 'TemplateSpec', mod='models') + + root_template = TemplateSpec(location=location, description=description, display_name=display_name, tags=tags) + return rcf.template_specs.create_or_update(resource_group_name, name, root_template) + + +def export_template_spec(cmd, output_folder, resource_group_name=None, name=None, version=None, template_spec=None): + rcf = _resource_templatespecs_client_factory(cmd.cli_ctx) + if template_spec: + id_parts = parse_resource_id(template_spec) + resource_group_name = id_parts.get('resource_group') + name = id_parts.get('name') + version = id_parts.get('resource_name') + if version == name: + version = None + exported_template = rcf.template_spec_versions.get(resource_group_name, name, version) if version else rcf.template_specs.get(resource_group_name, name) + from azure.cli.command_modules.resource._packing_engine import (unpack) + return unpack(cmd, exported_template, output_folder, (str(name) + '.JSON')) + + +def delete_template_spec(cmd, resource_group_name=None, name=None, version=None, template_spec=None): + rcf = _resource_templatespecs_client_factory(cmd.cli_ctx) + if template_spec: + id_parts = parse_resource_id(template_spec) + resource_group_name = id_parts.get('resource_group') + name = id_parts.get('name') + version = id_parts.get('resource_name') + if version == name: + version = None + if version: + return rcf.template_specs.delete(resource_group_name=resource_group_name, template_spec_name=name, template_spec_version=version) + return rcf.template_specs.delete(resource_group_name=resource_group_name, template_spec_name=name) + + +def list_template_specs(cmd, resource_group_name=None, name=None): + rcf = _resource_templatespecs_client_factory(cmd.cli_ctx) + if resource_group_name is not None: + if name is not None: + return rcf.template_spec_versions.list(resource_group_name=resource_group_name, template_spec_name=name) + return rcf.template_specs.list_by_resource_group(resource_group_name) + return rcf.template_specs.list_by_subscription() + + def list_deployment_operations_at_subscription_scope(cmd, deployment_name): rcf = _resource_client_factory(cmd.cli_ctx) return rcf.deployment_operations.list_at_subscription_scope(deployment_name) diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createKeyVault.json b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createKeyVault.json new file mode 100644 index 00000000000..595f9aa4a25 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createKeyVault.json @@ -0,0 +1,98 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "keyVaultName": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "skuName": { + "type": "string", + "defaultValue": "standard" + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]" + }, + "aadObjectId": { + "type": "string", + "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69" + } + }, + "variables": {}, + "resources": [ + { + "type": "Microsoft.KeyVault/vaults", + "name": "[parameters('keyVaultName')]", + "apiVersion": "2018-02-14", + "location": "[parameters('location')]", + "properties": { + "tenantId": "[parameters('tenantId')]", + "accessPolicies": [ + { + "tenantId": "[parameters('tenantId')]", + "objectId": "[parameters('aadObjectId')]", + "permissions": { + "keys": [ + "encrypt", + "decrypt", + "wrapKey", + "unwrapKey", + "sign", + "verify", + "get", + "list", + "create", + "update", + "import", + "delete", + "backup", + "restore", + "recover", + "purge" + ], + "secrets": [ + "get", + "list", + "set", + "delete", + "backup", + "restore", + "recover", + "purge" + ], + "certificates": [ + "get", + "list", + "delete", + "create", + "import", + "update", + "managecontacts", + "getissuers", + "listissuers", + "setissuers", + "deleteissuers", + "manageissuers", + "recover", + "purge" + ] + } + } + ], + "sku": { + "name": "[parameters('skuName')]", + "family": "A" + }, + "networkAcls": { + "defaultAction": "Allow", + "bypass": "AzureServices" + } + } + }, + ], + "outputs": {} +} \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createKeyVaultWithSecret.json b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createKeyVaultWithSecret.json new file mode 100644 index 00000000000..e3a32528c30 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createKeyVaultWithSecret.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "keyVaultName": { + "type": "string" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "skuName": { + "type": "string", + "defaultValue": "standard" + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]" + }, + "aadObjectId": { + "type": "string", + "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69" + } + }, + "variables": {}, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "keyVault", + "properties": { + "mode": "Incremental", + "templateLink": { + "relativePath":"createKeyVault.json", + "contentVersion":"1.0.0.0" + }, + "parameters": { + "keyVaultName":{"value": "[parameters('keyVaultName')]"}, + "location":{"value": "[parameters('location')]"}, + "skuName":{"value": "[parameters('skuName')]"}, + "tenantId":{"value": "[parameters('tenantId')]"}, + "aadObjectId":{"value": "[parameters('aadObjectId')]"}, + } + } + }, + { + "type": "Microsoft.KeyVault/vaults/secrets", + "apiVersion": "2018-02-14", + "name": "mySecret", + "name": "[concat(parameters('keyVaultName'), '/mySecret')]", + "location": "[parameters('location')]", + "dependsOn": [ + "keyVault" + ], + "properties": { + "value": "mySecretValue" + } + } + ], + "outputs": {} +} \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createResourceGroup.json b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createResourceGroup.json new file mode 100644 index 00000000000..b13db79e6f7 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/createResourceGroup.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "rgName": { + "type": "string" + }, + "rgLocation": { + "type": "string" + } + }, + "variables": {}, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2019-10-01", + "name": "[parameters('rgName')]", + "location": "[parameters('rgLocation')]", + "properties": {} + } + ], + "outputs": {} +} \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_create_template_specs.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_create_template_specs.yaml new file mode 100644 index 00000000000..bfafd0a695f --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_create_template_specs.yaml @@ -0,0 +1,379 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f -d --description --version-description + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002'' + under resource group ''cli_test_template_specs000001'' was not found. For + more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus", "properties": {"description": "AzCLI test root template + spec", "displayName": "create-spec000003"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '125' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f -d --description --version-description + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:57.5918146Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:57.5918146Z\"\r\n + \ },\r\n \"properties\": {\r\n \"displayName\": \"create-spec000003\",\r\n + \ \"description\": \"AzCLI test root template spec\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-create-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '819' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [{"path": "artifacts\\createResourceGroup.json", + "kind": "template", "template": {"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"rgName": {"type": "string"}, "rgLocation": + {"type": "string"}}, "variables": {}, "resources": [{"type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2019-10-01", "name": "[parameters(''rgName'')]", "location": + "[parameters(''rgLocation'')]", "properties": {}}], "outputs": {}}}, {"path": + "artifacts\\createKeyVault.json", "kind": "template", "template": {"$schema": + "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"keyVaultName": {"type": "string"}, + "location": {"type": "string", "defaultValue": "[resourceGroup().location]"}, + "skuName": {"type": "string", "defaultValue": "standard"}, "tenantId": {"type": + "string", "defaultValue": "[subscription().tenantId]"}, "aadObjectId": {"type": + "string", "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69"}}, "variables": + {}, "resources": [{"type": "Microsoft.KeyVault/vaults", "name": "[parameters(''keyVaultName'')]", + "apiVersion": "2018-02-14", "location": "[parameters(''location'')]", "properties": + {"tenantId": "[parameters(''tenantId'')]", "accessPolicies": [{"tenantId": "[parameters(''tenantId'')]", + "objectId": "[parameters(''aadObjectId'')]", "permissions": {"keys": ["encrypt", + "decrypt", "wrapKey", "unwrapKey", "sign", "verify", "get", "list", "create", + "update", "import", "delete", "backup", "restore", "recover", "purge"], "secrets": + ["get", "list", "set", "delete", "backup", "restore", "recover", "purge"], "certificates": + ["get", "list", "delete", "create", "import", "update", "managecontacts", "getissuers", + "listissuers", "setissuers", "deleteissuers", "manageissuers", "recover", "purge"]}}], + "sku": {"name": "[parameters(''skuName'')]", "family": "A"}, "networkAcls": + {"defaultAction": "Allow", "bypass": "AzureServices"}}}], "outputs": {}}}, {"path": + "artifacts\\createKeyVaultWithSecret.json", "kind": "template", "template": + {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"keyVaultName": {"type": "string"}, + "location": {"type": "string", "defaultValue": "[resourceGroup().location]"}, + "skuName": {"type": "string", "defaultValue": "standard"}, "tenantId": {"type": + "string", "defaultValue": "[subscription().tenantId]"}, "aadObjectId": {"type": + "string", "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69"}}, "variables": + {}, "resources": [{"type": "Microsoft.Resources/deployments", "apiVersion": + "2019-10-01", "name": "keyVault", "properties": {"mode": "Incremental", "templateLink": + {"relativePath": "createKeyVault.json", "contentVersion": "1.0.0.0"}, "parameters": + {"keyVaultName": {"value": "[parameters(''keyVaultName'')]"}, "location": {"value": + "[parameters(''location'')]"}, "skuName": {"value": "[parameters(''skuName'')]"}, + "tenantId": {"value": "[parameters(''tenantId'')]"}, "aadObjectId": {"value": + "[parameters(''aadObjectId'')]"}}}}, {"type": "Microsoft.KeyVault/vaults/secrets", + "apiVersion": "2018-02-14", "name": "[concat(parameters(''keyVaultName''), ''/mySecret'')]", + "location": "[parameters(''location'')]", "dependsOn": ["keyVault"], "properties": + {"value": "mySecretValue"}}], "outputs": {}}}], "description": "AzCLI test version + of root template spec", "template": {"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"rgName": {"type": "string"}, "rgLocation": + {"type": "string"}, "keyVaultName": {"type": "string"}}, "variables": {}, "resources": + [{"type": "Microsoft.Resources/deployments", "apiVersion": "2019-10-01", "name": + "deploymentRg", "location": "[parameters(''rgLocation'')]", "properties": {"mode": + "Incremental", "templateLink": {"relativePath": "artifacts/createResourceGroup.json", + "contentVersion": "1.0.0.0"}, "parameters": {"rgName": {"value": "[parameters(''rgName'')]"}, + "rgLocation": {"value": "[parameters(''rgLocation'')]"}}}}, {"type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", "name": "keyVaultAndSecret", "resourceGroup": "[parameters(''rgName'')]", + "dependsOn": ["deploymentRg"], "properties": {"mode": "Incremental", "templateLink": + {"relativePath": "artifacts/createKeyVaultWithSecret.json", "contentVersion": + "1.0.0.0"}, "parameters": {"keyVaultName": {"value": "[parameters(''keyVaultName'')]"}}}}], + "outputs": {}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '4596' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f -d --description --version-description + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:58.9718879Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.9718879Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"rgName\": {\r\n \"type\": \"string\"\r\n },\r\n + \ \"rgLocation\": {\r\n \"type\": \"string\"\r\n }\r\n + \ },\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"[parameters('rgName')]\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {}\r\n }\r\n ],\r\n \"outputs\": {}\r\n },\r\n + \ \"path\": \"artifacts\\\\createResourceGroup.json\",\r\n \"kind\": + \"template\"\r\n },\r\n {\r\n \"template\": {\r\n \"$schema\": + \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.KeyVault/vaults\",\r\n + \ \"name\": \"[parameters('keyVaultName')]\",\r\n \"apiVersion\": + \"2018-02-14\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"tenantId\": \"[parameters('tenantId')]\",\r\n + \ \"accessPolicies\": [\r\n {\r\n \"tenantId\": + \"[parameters('tenantId')]\",\r\n \"objectId\": \"[parameters('aadObjectId')]\",\r\n + \ \"permissions\": {\r\n \"keys\": + [\r\n \"encrypt\",\r\n \"decrypt\",\r\n + \ \"wrapKey\",\r\n \"unwrapKey\",\r\n + \ \"sign\",\r\n \"verify\",\r\n + \ \"get\",\r\n \"list\",\r\n + \ \"create\",\r\n \"update\",\r\n + \ \"import\",\r\n \"delete\",\r\n + \ \"backup\",\r\n \"restore\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ],\r\n \"secrets\": [\r\n \"get\",\r\n + \ \"list\",\r\n \"set\",\r\n + \ \"delete\",\r\n \"backup\",\r\n + \ \"restore\",\r\n \"recover\",\r\n + \ \"purge\"\r\n ],\r\n \"certificates\": + [\r\n \"get\",\r\n \"list\",\r\n + \ \"delete\",\r\n \"create\",\r\n + \ \"import\",\r\n \"update\",\r\n + \ \"managecontacts\",\r\n \"getissuers\",\r\n + \ \"listissuers\",\r\n \"setissuers\",\r\n + \ \"deleteissuers\",\r\n \"manageissuers\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ]\r\n }\r\n }\r\n + \ ],\r\n \"sku\": {\r\n \"name\": + \"[parameters('skuName')]\",\r\n \"family\": \"A\"\r\n },\r\n + \ \"networkAcls\": {\r\n \"defaultAction\": + \"Allow\",\r\n \"bypass\": \"AzureServices\"\r\n }\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVault.json\",\r\n + \ \"kind\": \"template\"\r\n },\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVault\",\r\n + \ \"properties\": {\r\n \"mode\": \"Incremental\",\r\n + \ \"templateLink\": {\r\n \"relativePath\": + \"createKeyVault.json\",\r\n \"contentVersion\": \"1.0.0.0\"\r\n + \ },\r\n \"parameters\": {\r\n \"keyVaultName\": + {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n },\r\n + \ \"location\": {\r\n \"value\": \"[parameters('location')]\"\r\n + \ },\r\n \"skuName\": {\r\n \"value\": + \"[parameters('skuName')]\"\r\n },\r\n \"tenantId\": + {\r\n \"value\": \"[parameters('tenantId')]\"\r\n },\r\n + \ \"aadObjectId\": {\r\n \"value\": \"[parameters('aadObjectId')]\"\r\n + \ }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.KeyVault/vaults/secrets\",\r\n + \ \"apiVersion\": \"2018-02-14\",\r\n \"name\": \"[concat(parameters('keyVaultName'), + '/mySecret')]\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"dependsOn\": [\r\n \"keyVault\"\r\n ],\r\n + \ \"properties\": {\r\n \"value\": \"mySecretValue\"\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVaultWithSecret.json\",\r\n + \ \"kind\": \"template\"\r\n }\r\n ],\r\n \"description\": + \"AzCLI test version of root template spec\",\r\n \"template\": {\r\n \"$schema\": + \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"rgName\": + {\r\n \"type\": \"string\"\r\n },\r\n \"rgLocation\": + {\r\n \"type\": \"string\"\r\n },\r\n \"keyVaultName\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": + {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"deploymentRg\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createResourceGroup.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"rgName\": {\r\n \"value\": \"[parameters('rgName')]\"\r\n + \ },\r\n \"rgLocation\": {\r\n \"value\": + \"[parameters('rgLocation')]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVaultAndSecret\",\r\n + \ \"resourceGroup\": \"[parameters('rgName')]\",\r\n \"dependsOn\": + [\r\n \"deploymentRg\"\r\n ],\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createKeyVaultWithSecret.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"keyVaultName\": {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n + \ }\r\n }\r\n }\r\n }\r\n ],\r\n + \ \"outputs\": {}\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '9426' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 16 Sep 2020 14:16:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_delete_template_spec.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_delete_template_spec.yaml new file mode 100644 index 00000000000..dc287616adb --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_delete_template_spec.yaml @@ -0,0 +1,490 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002'' + under resource group ''cli_test_template_specs000001'' was not found. For + more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:57.4061382Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:57.4061382Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-list-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '781' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:58.6212032Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.6212032Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts show + Connection: + - keep-alive + ParameterSetName: + - --template-spec + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:58.6212032Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.6212032Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts show + Connection: + - keep-alive + ParameterSetName: + - --template-spec + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:57.4061382Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.6212032Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-list-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 16 Sep 2020 14:16:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/?api-version=2019-06-01-preview + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:00 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: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Wed, 16 Sep 2020 14:16:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/?api-version=2019-06-01-preview + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:01 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 +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_export_template_spec.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_export_template_spec.yaml new file mode 100644 index 00000000000..2cfe6e5e200 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_export_template_spec.yaml @@ -0,0 +1,663 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004'' + under resource group ''cli_test_template_specs000001'' was not found. For + more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:12:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:12:11.844659Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:12:11.844659Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-export-template-spec000004\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '717' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:12:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [{"path": "artifacts\\createResourceGroup.json", + "kind": "template", "template": {"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"rgName": {"type": "string"}, "rgLocation": + {"type": "string"}}, "variables": {}, "resources": [{"type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2019-10-01", "name": "[parameters(''rgName'')]", "location": + "[parameters(''rgLocation'')]", "properties": {}}], "outputs": {}}}, {"path": + "artifacts\\createKeyVault.json", "kind": "template", "template": {"$schema": + "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"keyVaultName": {"type": "string"}, + "location": {"type": "string", "defaultValue": "[resourceGroup().location]"}, + "skuName": {"type": "string", "defaultValue": "standard"}, "tenantId": {"type": + "string", "defaultValue": "[subscription().tenantId]"}, "aadObjectId": {"type": + "string", "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69"}}, "variables": + {}, "resources": [{"type": "Microsoft.KeyVault/vaults", "name": "[parameters(''keyVaultName'')]", + "apiVersion": "2018-02-14", "location": "[parameters(''location'')]", "properties": + {"tenantId": "[parameters(''tenantId'')]", "accessPolicies": [{"tenantId": "[parameters(''tenantId'')]", + "objectId": "[parameters(''aadObjectId'')]", "permissions": {"keys": ["encrypt", + "decrypt", "wrapKey", "unwrapKey", "sign", "verify", "get", "list", "create", + "update", "import", "delete", "backup", "restore", "recover", "purge"], "secrets": + ["get", "list", "set", "delete", "backup", "restore", "recover", "purge"], "certificates": + ["get", "list", "delete", "create", "import", "update", "managecontacts", "getissuers", + "listissuers", "setissuers", "deleteissuers", "manageissuers", "recover", "purge"]}}], + "sku": {"name": "[parameters(''skuName'')]", "family": "A"}, "networkAcls": + {"defaultAction": "Allow", "bypass": "AzureServices"}}}], "outputs": {}}}, {"path": + "artifacts\\createKeyVaultWithSecret.json", "kind": "template", "template": + {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"keyVaultName": {"type": "string"}, + "location": {"type": "string", "defaultValue": "[resourceGroup().location]"}, + "skuName": {"type": "string", "defaultValue": "standard"}, "tenantId": {"type": + "string", "defaultValue": "[subscription().tenantId]"}, "aadObjectId": {"type": + "string", "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69"}}, "variables": + {}, "resources": [{"type": "Microsoft.Resources/deployments", "apiVersion": + "2019-10-01", "name": "keyVault", "properties": {"mode": "Incremental", "templateLink": + {"relativePath": "createKeyVault.json", "contentVersion": "1.0.0.0"}, "parameters": + {"keyVaultName": {"value": "[parameters(''keyVaultName'')]"}, "location": {"value": + "[parameters(''location'')]"}, "skuName": {"value": "[parameters(''skuName'')]"}, + "tenantId": {"value": "[parameters(''tenantId'')]"}, "aadObjectId": {"value": + "[parameters(''aadObjectId'')]"}}}}, {"type": "Microsoft.KeyVault/vaults/secrets", + "apiVersion": "2018-02-14", "name": "[concat(parameters(''keyVaultName''), ''/mySecret'')]", + "location": "[parameters(''location'')]", "dependsOn": ["keyVault"], "properties": + {"value": "mySecretValue"}}], "outputs": {}}}], "template": {"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"rgName": {"type": "string"}, "rgLocation": + {"type": "string"}, "keyVaultName": {"type": "string"}}, "variables": {}, "resources": + [{"type": "Microsoft.Resources/deployments", "apiVersion": "2019-10-01", "name": + "deploymentRg", "location": "[parameters(''rgLocation'')]", "properties": {"mode": + "Incremental", "templateLink": {"relativePath": "artifacts/createResourceGroup.json", + "contentVersion": "1.0.0.0"}, "parameters": {"rgName": {"value": "[parameters(''rgName'')]"}, + "rgLocation": {"value": "[parameters(''rgLocation'')]"}}}}, {"type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", "name": "keyVaultAndSecret", "resourceGroup": "[parameters(''rgName'')]", + "dependsOn": ["deploymentRg"], "properties": {"mode": "Incremental", "templateLink": + {"relativePath": "artifacts/createKeyVaultWithSecret.json", "contentVersion": + "1.0.0.0"}, "parameters": {"keyVaultName": {"value": "[parameters(''keyVaultName'')]"}}}}], + "outputs": {}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '4537' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:12:13.0447005Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:12:13.0447005Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"rgName\": {\r\n \"type\": \"string\"\r\n },\r\n + \ \"rgLocation\": {\r\n \"type\": \"string\"\r\n }\r\n + \ },\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"[parameters('rgName')]\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {}\r\n }\r\n ],\r\n \"outputs\": {}\r\n },\r\n + \ \"path\": \"artifacts\\\\createResourceGroup.json\",\r\n \"kind\": + \"template\"\r\n },\r\n {\r\n \"template\": {\r\n \"$schema\": + \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.KeyVault/vaults\",\r\n + \ \"name\": \"[parameters('keyVaultName')]\",\r\n \"apiVersion\": + \"2018-02-14\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"tenantId\": \"[parameters('tenantId')]\",\r\n + \ \"accessPolicies\": [\r\n {\r\n \"tenantId\": + \"[parameters('tenantId')]\",\r\n \"objectId\": \"[parameters('aadObjectId')]\",\r\n + \ \"permissions\": {\r\n \"keys\": + [\r\n \"encrypt\",\r\n \"decrypt\",\r\n + \ \"wrapKey\",\r\n \"unwrapKey\",\r\n + \ \"sign\",\r\n \"verify\",\r\n + \ \"get\",\r\n \"list\",\r\n + \ \"create\",\r\n \"update\",\r\n + \ \"import\",\r\n \"delete\",\r\n + \ \"backup\",\r\n \"restore\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ],\r\n \"secrets\": [\r\n \"get\",\r\n + \ \"list\",\r\n \"set\",\r\n + \ \"delete\",\r\n \"backup\",\r\n + \ \"restore\",\r\n \"recover\",\r\n + \ \"purge\"\r\n ],\r\n \"certificates\": + [\r\n \"get\",\r\n \"list\",\r\n + \ \"delete\",\r\n \"create\",\r\n + \ \"import\",\r\n \"update\",\r\n + \ \"managecontacts\",\r\n \"getissuers\",\r\n + \ \"listissuers\",\r\n \"setissuers\",\r\n + \ \"deleteissuers\",\r\n \"manageissuers\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ]\r\n }\r\n }\r\n + \ ],\r\n \"sku\": {\r\n \"name\": + \"[parameters('skuName')]\",\r\n \"family\": \"A\"\r\n },\r\n + \ \"networkAcls\": {\r\n \"defaultAction\": + \"Allow\",\r\n \"bypass\": \"AzureServices\"\r\n }\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVault.json\",\r\n + \ \"kind\": \"template\"\r\n },\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVault\",\r\n + \ \"properties\": {\r\n \"mode\": \"Incremental\",\r\n + \ \"templateLink\": {\r\n \"relativePath\": + \"createKeyVault.json\",\r\n \"contentVersion\": \"1.0.0.0\"\r\n + \ },\r\n \"parameters\": {\r\n \"keyVaultName\": + {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n },\r\n + \ \"location\": {\r\n \"value\": \"[parameters('location')]\"\r\n + \ },\r\n \"skuName\": {\r\n \"value\": + \"[parameters('skuName')]\"\r\n },\r\n \"tenantId\": + {\r\n \"value\": \"[parameters('tenantId')]\"\r\n },\r\n + \ \"aadObjectId\": {\r\n \"value\": \"[parameters('aadObjectId')]\"\r\n + \ }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.KeyVault/vaults/secrets\",\r\n + \ \"apiVersion\": \"2018-02-14\",\r\n \"name\": \"[concat(parameters('keyVaultName'), + '/mySecret')]\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"dependsOn\": [\r\n \"keyVault\"\r\n ],\r\n + \ \"properties\": {\r\n \"value\": \"mySecretValue\"\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVaultWithSecret.json\",\r\n + \ \"kind\": \"template\"\r\n }\r\n ],\r\n \"template\": {\r\n + \ \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"rgName\": + {\r\n \"type\": \"string\"\r\n },\r\n \"rgLocation\": + {\r\n \"type\": \"string\"\r\n },\r\n \"keyVaultName\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": + {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"deploymentRg\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createResourceGroup.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"rgName\": {\r\n \"value\": \"[parameters('rgName')]\"\r\n + \ },\r\n \"rgLocation\": {\r\n \"value\": + \"[parameters('rgLocation')]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVaultAndSecret\",\r\n + \ \"resourceGroup\": \"[parameters('rgName')]\",\r\n \"dependsOn\": + [\r\n \"deploymentRg\"\r\n ],\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createKeyVaultWithSecret.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"keyVaultName\": {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n + \ }\r\n }\r\n }\r\n }\r\n ],\r\n + \ \"outputs\": {}\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '9362' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:12:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts export + Connection: + - keep-alive + ParameterSetName: + - -g --name --version --output-folder + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:12:13.0447005Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:12:13.0447005Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"rgName\": {\r\n \"type\": \"string\"\r\n },\r\n + \ \"rgLocation\": {\r\n \"type\": \"string\"\r\n }\r\n + \ },\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"[parameters('rgName')]\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {}\r\n }\r\n ],\r\n \"outputs\": {}\r\n },\r\n + \ \"path\": \"artifacts\\\\createResourceGroup.json\",\r\n \"kind\": + \"template\"\r\n },\r\n {\r\n \"template\": {\r\n \"$schema\": + \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.KeyVault/vaults\",\r\n + \ \"name\": \"[parameters('keyVaultName')]\",\r\n \"apiVersion\": + \"2018-02-14\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"tenantId\": \"[parameters('tenantId')]\",\r\n + \ \"accessPolicies\": [\r\n {\r\n \"tenantId\": + \"[parameters('tenantId')]\",\r\n \"objectId\": \"[parameters('aadObjectId')]\",\r\n + \ \"permissions\": {\r\n \"keys\": + [\r\n \"encrypt\",\r\n \"decrypt\",\r\n + \ \"wrapKey\",\r\n \"unwrapKey\",\r\n + \ \"sign\",\r\n \"verify\",\r\n + \ \"get\",\r\n \"list\",\r\n + \ \"create\",\r\n \"update\",\r\n + \ \"import\",\r\n \"delete\",\r\n + \ \"backup\",\r\n \"restore\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ],\r\n \"secrets\": [\r\n \"get\",\r\n + \ \"list\",\r\n \"set\",\r\n + \ \"delete\",\r\n \"backup\",\r\n + \ \"restore\",\r\n \"recover\",\r\n + \ \"purge\"\r\n ],\r\n \"certificates\": + [\r\n \"get\",\r\n \"list\",\r\n + \ \"delete\",\r\n \"create\",\r\n + \ \"import\",\r\n \"update\",\r\n + \ \"managecontacts\",\r\n \"getissuers\",\r\n + \ \"listissuers\",\r\n \"setissuers\",\r\n + \ \"deleteissuers\",\r\n \"manageissuers\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ]\r\n }\r\n }\r\n + \ ],\r\n \"sku\": {\r\n \"name\": + \"[parameters('skuName')]\",\r\n \"family\": \"A\"\r\n },\r\n + \ \"networkAcls\": {\r\n \"defaultAction\": + \"Allow\",\r\n \"bypass\": \"AzureServices\"\r\n }\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVault.json\",\r\n + \ \"kind\": \"template\"\r\n },\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVault\",\r\n + \ \"properties\": {\r\n \"mode\": \"Incremental\",\r\n + \ \"templateLink\": {\r\n \"relativePath\": + \"createKeyVault.json\",\r\n \"contentVersion\": \"1.0.0.0\"\r\n + \ },\r\n \"parameters\": {\r\n \"keyVaultName\": + {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n },\r\n + \ \"location\": {\r\n \"value\": \"[parameters('location')]\"\r\n + \ },\r\n \"skuName\": {\r\n \"value\": + \"[parameters('skuName')]\"\r\n },\r\n \"tenantId\": + {\r\n \"value\": \"[parameters('tenantId')]\"\r\n },\r\n + \ \"aadObjectId\": {\r\n \"value\": \"[parameters('aadObjectId')]\"\r\n + \ }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.KeyVault/vaults/secrets\",\r\n + \ \"apiVersion\": \"2018-02-14\",\r\n \"name\": \"[concat(parameters('keyVaultName'), + '/mySecret')]\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"dependsOn\": [\r\n \"keyVault\"\r\n ],\r\n + \ \"properties\": {\r\n \"value\": \"mySecretValue\"\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVaultWithSecret.json\",\r\n + \ \"kind\": \"template\"\r\n }\r\n ],\r\n \"template\": {\r\n + \ \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"rgName\": + {\r\n \"type\": \"string\"\r\n },\r\n \"rgLocation\": + {\r\n \"type\": \"string\"\r\n },\r\n \"keyVaultName\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": + {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"deploymentRg\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createResourceGroup.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"rgName\": {\r\n \"value\": \"[parameters('rgName')]\"\r\n + \ },\r\n \"rgLocation\": {\r\n \"value\": + \"[parameters('rgLocation')]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVaultAndSecret\",\r\n + \ \"resourceGroup\": \"[parameters('rgName')]\",\r\n \"dependsOn\": + [\r\n \"deploymentRg\"\r\n ],\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createKeyVaultWithSecret.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"keyVaultName\": {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n + \ }\r\n }\r\n }\r\n }\r\n ],\r\n + \ \"outputs\": {}\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '9362' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:12:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts export + Connection: + - keep-alive + ParameterSetName: + - --template-spec --output-folder + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:12:13.0447005Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:12:13.0447005Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"rgName\": {\r\n \"type\": \"string\"\r\n },\r\n + \ \"rgLocation\": {\r\n \"type\": \"string\"\r\n }\r\n + \ },\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"[parameters('rgName')]\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {}\r\n }\r\n ],\r\n \"outputs\": {}\r\n },\r\n + \ \"path\": \"artifacts\\\\createResourceGroup.json\",\r\n \"kind\": + \"template\"\r\n },\r\n {\r\n \"template\": {\r\n \"$schema\": + \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.KeyVault/vaults\",\r\n + \ \"name\": \"[parameters('keyVaultName')]\",\r\n \"apiVersion\": + \"2018-02-14\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"tenantId\": \"[parameters('tenantId')]\",\r\n + \ \"accessPolicies\": [\r\n {\r\n \"tenantId\": + \"[parameters('tenantId')]\",\r\n \"objectId\": \"[parameters('aadObjectId')]\",\r\n + \ \"permissions\": {\r\n \"keys\": + [\r\n \"encrypt\",\r\n \"decrypt\",\r\n + \ \"wrapKey\",\r\n \"unwrapKey\",\r\n + \ \"sign\",\r\n \"verify\",\r\n + \ \"get\",\r\n \"list\",\r\n + \ \"create\",\r\n \"update\",\r\n + \ \"import\",\r\n \"delete\",\r\n + \ \"backup\",\r\n \"restore\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ],\r\n \"secrets\": [\r\n \"get\",\r\n + \ \"list\",\r\n \"set\",\r\n + \ \"delete\",\r\n \"backup\",\r\n + \ \"restore\",\r\n \"recover\",\r\n + \ \"purge\"\r\n ],\r\n \"certificates\": + [\r\n \"get\",\r\n \"list\",\r\n + \ \"delete\",\r\n \"create\",\r\n + \ \"import\",\r\n \"update\",\r\n + \ \"managecontacts\",\r\n \"getissuers\",\r\n + \ \"listissuers\",\r\n \"setissuers\",\r\n + \ \"deleteissuers\",\r\n \"manageissuers\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ]\r\n }\r\n }\r\n + \ ],\r\n \"sku\": {\r\n \"name\": + \"[parameters('skuName')]\",\r\n \"family\": \"A\"\r\n },\r\n + \ \"networkAcls\": {\r\n \"defaultAction\": + \"Allow\",\r\n \"bypass\": \"AzureServices\"\r\n }\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVault.json\",\r\n + \ \"kind\": \"template\"\r\n },\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVault\",\r\n + \ \"properties\": {\r\n \"mode\": \"Incremental\",\r\n + \ \"templateLink\": {\r\n \"relativePath\": + \"createKeyVault.json\",\r\n \"contentVersion\": \"1.0.0.0\"\r\n + \ },\r\n \"parameters\": {\r\n \"keyVaultName\": + {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n },\r\n + \ \"location\": {\r\n \"value\": \"[parameters('location')]\"\r\n + \ },\r\n \"skuName\": {\r\n \"value\": + \"[parameters('skuName')]\"\r\n },\r\n \"tenantId\": + {\r\n \"value\": \"[parameters('tenantId')]\"\r\n },\r\n + \ \"aadObjectId\": {\r\n \"value\": \"[parameters('aadObjectId')]\"\r\n + \ }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.KeyVault/vaults/secrets\",\r\n + \ \"apiVersion\": \"2018-02-14\",\r\n \"name\": \"[concat(parameters('keyVaultName'), + '/mySecret')]\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"dependsOn\": [\r\n \"keyVault\"\r\n ],\r\n + \ \"properties\": {\r\n \"value\": \"mySecretValue\"\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVaultWithSecret.json\",\r\n + \ \"kind\": \"template\"\r\n }\r\n ],\r\n \"template\": {\r\n + \ \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"rgName\": + {\r\n \"type\": \"string\"\r\n },\r\n \"rgLocation\": + {\r\n \"type\": \"string\"\r\n },\r\n \"keyVaultName\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": + {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"deploymentRg\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createResourceGroup.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"rgName\": {\r\n \"value\": \"[parameters('rgName')]\"\r\n + \ },\r\n \"rgLocation\": {\r\n \"value\": + \"[parameters('rgLocation')]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVaultAndSecret\",\r\n + \ \"resourceGroup\": \"[parameters('rgName')]\",\r\n \"dependsOn\": + [\r\n \"deploymentRg\"\r\n ],\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createKeyVaultWithSecret.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"keyVaultName\": {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n + \ }\r\n }\r\n }\r\n }\r\n ],\r\n + \ \"outputs\": {}\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-export-template-spec000004/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '9362' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:12:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_list_template_spec.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_list_template_spec.yaml new file mode 100644 index 00000000000..27ad869a651 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_list_template_spec.yaml @@ -0,0 +1,877 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003'' + under resource group ''cli_test_template_specs_list000002'' was not found. + For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:58.4392827Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.4392827Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-list-template-spec000003\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '781' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:59.5191367Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:59.5191367Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003'' + under resource group ''cli_test_template_specs_list000001'' was not found. + For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:01.3014735Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:01.3014735Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-list-template-spec000003\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '781' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/2.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:02.4979506Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:02.4979506Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/2.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"2.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:01.3014735Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:02.4979506Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-list-template-spec000003\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '781' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/3.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:04.7413092Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:04.7413092Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/3.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"3.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: + - ts list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n + \ \"systemData\": {\r\n \"createdBy\": \"daetienn@microsoft.com\",\r\n + \ \"createdByType\": \"User\",\r\n \"createdAt\": \"2020-09-16T14:16:01.3014735Z\",\r\n + \ \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n \"lastModifiedByType\": + \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:04.7413092Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": + \"cli-test-list-template-spec000003\"\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '804' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n + \ \"systemData\": {\r\n \"createdBy\": \"daetienn@microsoft.com\",\r\n + \ \"createdByType\": \"User\",\r\n \"createdAt\": \"2020-09-16T14:15:58.4392827Z\",\r\n + \ \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n \"lastModifiedByType\": + \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:59.5191367Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": + \"cli-test-list-template-spec000003\"\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '804' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts list + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n + \ \"systemData\": {\r\n \"createdBy\": \"daetienn@microsoft.com\",\r\n + \ \"createdByType\": \"User\",\r\n \"createdAt\": \"2020-09-16T14:16:02.4979506Z\",\r\n + \ \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n \"lastModifiedByType\": + \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:02.4979506Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"location\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"[resourceGroup().location]\",\r\n \"metadata\": {\r\n \"description\": + \"Location for the network security group.\"\r\n }\r\n },\r\n + \ \"name\": {\r\n \"type\": \"string\",\r\n \"metadata\": + {\r\n \"description\": \"Name of the network security group.\"\r\n + \ }\r\n }\r\n },\r\n \"variables\": + {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": + \"[parameters('location')]\",\r\n \"properties\": {\r\n \"securityRules\": + []\r\n },\r\n \"dependsOn\": []\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"NewNSG\": {\r\n + \ \"type\": \"object\",\r\n \"value\": \"[reference(parameters('name'))]\"\r\n + \ }\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/2.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"2.0\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"systemData\": + {\r\n \"createdBy\": \"daetienn@microsoft.com\",\r\n \"createdByType\": + \"User\",\r\n \"createdAt\": \"2020-09-16T14:16:04.7413092Z\",\r\n + \ \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n \"lastModifiedByType\": + \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:04.7413092Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"location\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"[resourceGroup().location]\",\r\n \"metadata\": {\r\n \"description\": + \"Location for the network security group.\"\r\n }\r\n },\r\n + \ \"name\": {\r\n \"type\": \"string\",\r\n \"metadata\": + {\r\n \"description\": \"Name of the network security group.\"\r\n + \ }\r\n }\r\n },\r\n \"variables\": + {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": + \"[parameters('location')]\",\r\n \"properties\": {\r\n \"securityRules\": + []\r\n },\r\n \"dependsOn\": []\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"NewNSG\": {\r\n + \ \"type\": \"object\",\r\n \"value\": \"[reference(parameters('name'))]\"\r\n + \ }\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003/versions/3.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"3.0\"\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '4102' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts list + Connection: + - keep-alive + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/templateSpecs/?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n + \ \"systemData\": {\r\n \"createdBy\": \"daetienn@microsoft.com\",\r\n + \ \"createdByType\": \"User\",\r\n \"createdAt\": \"2020-09-16T14:15:58.4392827Z\",\r\n + \ \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n \"lastModifiedByType\": + \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:59.5191367Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": + \"cli-test-list-template-spec000003\"\r\n },\r\n {\r\n \"location\": + \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": \"daetienn@microsoft.com\",\r\n + \ \"createdByType\": \"User\",\r\n \"createdAt\": \"2020-09-16T14:16:01.3014735Z\",\r\n + \ \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n \"lastModifiedByType\": + \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:04.7413092Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": + \"cli-test-list-template-spec000003\"\r\n },\r\n {\r\n \"location\": + \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": \"daetienn@microsoft.com\",\r\n + \ \"createdByType\": \"User\",\r\n \"createdAt\": \"2020-09-16T14:16:04.4617274Z\",\r\n + \ \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n \"lastModifiedByType\": + \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:06.6159216Z\"\r\n + \ },\r\n \"properties\": {\r\n \"displayName\": \"create-spec7xrtm3kjd\",\r\n + \ \"description\": \"AzCLI test root template spec\"\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specswv52vejwhnw3shpxh7c4xtchqsuo2qtadifec27se3dgt73lyg7m/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-specbmlhayrdfuh2eniewjxahkfmheakdmv\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": + \"cli-test-update-template-specbmlhayrdfuh2eniewjxahkfmheakdmv\"\r\n }\r\n + \ ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2480' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000002/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 16 Sep 2020 14:16:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_list000001/providers/Microsoft.Resources/templateSpecs/cli-test-list-template-spec000003?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 16 Sep 2020 14:16:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group_deployment_ts.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group_deployment_ts.yaml new file mode 100644 index 00000000000..4d197de8fdd --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group_deployment_ts.yaml @@ -0,0 +1,1374 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002'' + under resource group ''cli_test_template_specs_resource_group_deployment000001'' + was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:49:35.0935467Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:49:35.0935467Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-resource-group-ts-deploy000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '781' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:49:36.238556Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:49:36.238556Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1815' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group validate + Connection: + - keep-alive + ParameterSetName: + - --resource-group --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15916' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:37 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 validate + Connection: + - keep-alive + ParameterSetName: + - --resource-group --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:49:36.238556Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:49:36.238556Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1815' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0"}, + "parameters": {"location": {"value": "westus"}, "name": {"value": "azure-cli-deploy-test-nsg1"}}, + "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group validate + Connection: + - keep-alive + Content-Length: + - '425' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:39.2097362Z","duration":"PT0S","correlationId":"33fc6667-a7d6-4a51-9367-7312409d46d1","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1303' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49: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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group create + Connection: + - keep-alive + ParameterSetName: + - --resource-group -n --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15916' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:39 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: + - --resource-group -n --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:49:36.238556Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:49:36.238556Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1815' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:40 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0"}, + "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: + - '425' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group -n --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003","name":"azure-cli-resource-group-deployment000003","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:41.8400946Z","duration":"PT0S","correlationId":"7d2937f3-775e-413d-86fd-8743c57f5821","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1421' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49:41 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": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0"}, + "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: + - '425' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group -n --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003","name":"azure-cli-resource-group-deployment000003","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-08-20T15:49:43.3089512Z","duration":"PT0.7765253S","correlationId":"8a378cf4-b243-4721-b623-5177ab7a1425","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_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003/operationStatuses/08586036683029452387?api-version=2020-06-01 + cache-control: + - no-cache + content-length: + - '1176' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:49: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: + - --resource-group -n --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586036683029452387?api-version=2020-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:13 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: + - --resource-group -n --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003","name":"azure-cli-resource-group-deployment000003","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:52.8967943Z","duration":"PT10.3643684S","correlationId":"8a378cf4-b243-4721-b623-5177ab7a1425","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"89d0ced7-7b53-4a21-8b37-17e0b165b7a2","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '5888' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50: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 list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/?api-version=2020-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003","name":"azure-cli-resource-group-deployment000003","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:52.8967943Z","duration":"PT10.3643684S","correlationId":"8a378cf4-b243-4721-b623-5177ab7a1425","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"89d0ced7-7b53-4a21-8b37-17e0b165b7a2","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '5900' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:15 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 list + Connection: + - keep-alive + ParameterSetName: + - --resource-group --filter + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/?$filter=provisioningState%20eq%20%27Succeeded%27&api-version=2020-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003","name":"azure-cli-resource-group-deployment000003","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:52.8967943Z","duration":"PT10.3643684S","correlationId":"8a378cf4-b243-4721-b623-5177ab7a1425","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"89d0ced7-7b53-4a21-8b37-17e0b165b7a2","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '5900' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:16 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 show + Connection: + - keep-alive + ParameterSetName: + - --resource-group -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003","name":"azure-cli-resource-group-deployment000003","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:52.8967943Z","duration":"PT10.3643684S","correlationId":"8a378cf4-b243-4721-b623-5177ab7a1425","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"newNSG":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"89d0ced7-7b53-4a21-8b37-17e0b165b7a2","securityRules":[],"defaultSecurityRules":[{"name":"AllowVnetInBound","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllInBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowVnetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/AllowInternetOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1/defaultSecurityRules/DenyAllOutBound","etag":"W/\"01ebf002-9818-48d5-8b4e-457d4b955a25\"","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_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '5888' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:17 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 export + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/exportTemplate?api-version=2020-06-01 + response: + body: + string: '{"template":{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{"location":{"defaultValue":"[resourceGroup().location]","type":"String","metadata":{"description":"Location + for the network security group."}},"name":{"type":"String","metadata":{"description":"Name + of the network security group."}}},"variables":{},"resources":[{"type":"Microsoft.Network/networkSecurityGroups","apiVersion":"2015-06-15","name":"[parameters(''name'')]","location":"[parameters(''location'')]","dependsOn":[],"properties":{"securityRules":[]}}],"outputs":{"NewNSG":{"type":"Object","value":"[reference(parameters(''name''))]"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '685' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:17 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment operation group list + Connection: + - keep-alive + ParameterSetName: + - --resource-group -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/deployments/mock-deployment/operations?api-version=2020-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003/operations/0ACD93EF8062E65A","operationId":"0ACD93EF8062E65A","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:51.7036974Z","duration":"PT6.8191053S","trackingId":"ef953f70-83fc-4763-8ee4-7c64c28a978b","serviceRequestId":"fde15b23-1543-4d5f-b68e-4036663c3e23","statusCode":"OK","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"azure-cli-deploy-test-nsg1"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000003/operations/08586036683029452387","operationId":"08586036683029452387","properties":{"provisioningOperation":"EvaluateDeploymentOutput","provisioningState":"Succeeded","timestamp":"2020-08-20T15:49:52.641409Z","duration":"PT0.4443375S","trackingId":"bcdfa658-d21e-479e-b9aa-4e74eaf19d9d","statusCode":"OK"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1511' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:18 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: + - --resource-group -n --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15916' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:19 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: + - --resource-group -n --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:49:36.238556Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:49:36.238556Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1815' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0"}, + "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: + - '425' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group -n --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000004","name":"azure-cli-resource-group-deployment000004","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:50:21.6478862Z","duration":"PT0S","correlationId":"fe63a517-e6bf-410e-a217-4df30b47969a","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Network/networkSecurityGroups/azure-cli-deploy-test-nsg1"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1421' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:21 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": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0"}, + "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: + - '425' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group -n --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000004","name":"azure-cli-resource-group-deployment000004","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-08-20T15:50:23.0756731Z","duration":"PT0.7549307S","correlationId":"2b302936-a289-4d1c-8168-abcbb995c668","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_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000004/operationStatuses/08586036682631568699?api-version=2020-06-01 + cache-control: + - no-cache + content-length: + - '1176' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:23 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 cancel + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment/cancel?api-version=2020-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Thu, 20 Aug 2020 15:50:24 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: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/deployments/azure-cli-resource-group-deployment000004","name":"azure-cli-resource-group-deployment000004","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_resource_group_deployment000001/providers/Microsoft.Resources/templateSpecs/cli-test-resource-group-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"6836373655278635521","parameters":{"location":{"type":"String","value":"westus"},"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"}},"mode":"Incremental","provisioningState":"Canceled","timestamp":"2020-08-20T15:50:24.7816376Z","duration":"PT2.4608952S","correlationId":"2b302936-a289-4d1c-8168-abcbb995c668","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '1176' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:50:25 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 +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group_level_what_if_ts.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group_level_what_if_ts.yaml new file mode 100644 index 00000000000..4fbe55b17f9 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group_level_what_if_ts.yaml @@ -0,0 +1,813 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002'' + under resource group ''cli_test_deployment_what_if_template_specs000001'' + was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:16:04.399641Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:16:04.399641Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-deploy-what-if-rg-deploy000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '717' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"storageAccountType": {"type": "string", + "defaultValue": "Standard_LRS", "allowedValues": ["Standard_LRS", "Standard_GRS", + "Standard_ZRS", "Premium_LRS"], "metadata": {"description": "Storage Account + type"}}, "location": {"type": "string", "defaultValue": "[resourceGroup().location]", + "metadata": {"description": "Location for all resources."}}}, "variables": {"storageAccountName": + "[concat(''store'', uniquestring(resourceGroup().id))]"}, "resources": [{"type": + "Microsoft.Storage/storageAccounts", "apiVersion": "2019-04-01", "name": "[variables(''storageAccountName'')]", + "location": "[parameters(''location'')]", "sku": {"name": "[parameters(''storageAccountType'')]"}, + "kind": "StorageV2", "properties": {}}], "outputs": {"storageAccountId": {"type": + "string", "value": "[resourceId(''Microsoft.Storage/storageAccounts'', variables(''storageAccountName''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '1064' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:16:05.7047064Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:16:05.7047064Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountType\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"Standard_LRS\",\r\n + \ \"allowedValues\": [\r\n \"Standard_LRS\",\r\n \"Standard_GRS\",\r\n + \ \"Standard_ZRS\",\r\n \"Premium_LRS\"\r\n ],\r\n + \ \"metadata\": {\r\n \"description\": \"Storage Account + type\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for all + resources.\"\r\n }\r\n }\r\n },\r\n \"variables\": + {\r\n \"storageAccountName\": \"[concat('store', uniquestring(resourceGroup().id))]\"\r\n + \ },\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n + \ \"apiVersion\": \"2019-04-01\",\r\n \"name\": \"[variables('storageAccountName')]\",\r\n + \ \"location\": \"[parameters('location')]\",\r\n \"sku\": + {\r\n \"name\": \"[parameters('storageAccountType')]\"\r\n },\r\n + \ \"kind\": \"StorageV2\",\r\n \"properties\": {}\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"storageAccountId\": {\r\n \"type\": + \"string\",\r\n \"value\": \"[resourceId('Microsoft.Storage/storageAccounts', + variables('storageAccountName'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2216' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15846' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:06 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: + - --resource-group --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:16:05.7047064Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:16:05.7047064Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountType\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"Standard_LRS\",\r\n + \ \"allowedValues\": [\r\n \"Standard_LRS\",\r\n \"Standard_GRS\",\r\n + \ \"Standard_ZRS\",\r\n \"Premium_LRS\"\r\n ],\r\n + \ \"metadata\": {\r\n \"description\": \"Storage Account + type\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for all + resources.\"\r\n }\r\n }\r\n },\r\n \"variables\": + {\r\n \"storageAccountName\": \"[concat('store', uniquestring(resourceGroup().id))]\"\r\n + \ },\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n + \ \"apiVersion\": \"2019-04-01\",\r\n \"name\": \"[variables('storageAccountName')]\",\r\n + \ \"location\": \"[parameters('location')]\",\r\n \"sku\": + {\r\n \"name\": \"[parameters('storageAccountType')]\"\r\n },\r\n + \ \"kind\": \"StorageV2\",\r\n \"properties\": {}\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"storageAccountId\": {\r\n \"type\": + \"string\",\r\n \"value\": \"[resourceId('Microsoft.Storage/storageAccounts', + variables('storageAccountName'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2216' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0"}, + "parameters": {}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group create + Connection: + - keep-alive + Content-Length: + - '345' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"17777275051920256744","parameters":{"storageAccountType":{"type":"String","value":"Standard_LRS"},"location":{"type":"String","value":"westus"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-05T21:16:08.6706522Z","duration":"PT0S","correlationId":"5874a638-e556-41a6-894b-3c52a35da5fc","providers":[{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Storage/storageAccounts/storele7wnsppphwea"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1284' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:09 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": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0"}, + "parameters": {}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group create + Connection: + - keep-alive + Content-Length: + - '345' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"17777275051920256744","parameters":{"storageAccountType":{"type":"String","value":"Standard_LRS"},"location":{"type":"String","value":"westus"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-08-05T21:16:10.0886933Z","duration":"PT0.2972051S","correlationId":"82fb0684-936d-4d72-9a76-3d378044cec6","providers":[{"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_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/1/operationStatuses/08586049447156861208?api-version=2020-06-01 + cache-control: + - no-cache + content-length: + - '1053' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:10 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: + - --resource-group --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586049447156861208?api-version=2020-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:40 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: + - --resource-group --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"17777275051920256744","parameters":{"storageAccountType":{"type":"String","value":"Standard_LRS"},"location":{"type":"String","value":"westus"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-05T21:16:32.6797058Z","duration":"PT22.8882176S","correlationId":"82fb0684-936d-4d72-9a76-3d378044cec6","providers":[{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]}],"dependencies":[],"outputs":{"storageAccountId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Storage/storageAccounts/storele7wnsppphwea"}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Storage/storageAccounts/storele7wnsppphwea"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1555' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:41 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 what-if + Connection: + - keep-alive + ParameterSetName: + - --resource-group --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15846' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:42 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 what-if + Connection: + - keep-alive + ParameterSetName: + - --resource-group --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:16:05.7047064Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:16:05.7047064Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountType\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"Standard_LRS\",\r\n + \ \"allowedValues\": [\r\n \"Standard_LRS\",\r\n \"Standard_GRS\",\r\n + \ \"Standard_ZRS\",\r\n \"Premium_LRS\"\r\n ],\r\n + \ \"metadata\": {\r\n \"description\": \"Storage Account + type\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for all + resources.\"\r\n }\r\n }\r\n },\r\n \"variables\": + {\r\n \"storageAccountName\": \"[concat('store', uniquestring(resourceGroup().id))]\"\r\n + \ },\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n + \ \"apiVersion\": \"2019-04-01\",\r\n \"name\": \"[variables('storageAccountName')]\",\r\n + \ \"location\": \"[parameters('location')]\",\r\n \"sku\": + {\r\n \"name\": \"[parameters('storageAccountType')]\"\r\n },\r\n + \ \"kind\": \"StorageV2\",\r\n \"properties\": {}\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"storageAccountId\": {\r\n \"type\": + \"string\",\r\n \"value\": \"[resourceId('Microsoft.Storage/storageAccounts', + variables('storageAccountName'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2216' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0"}, + "parameters": {"storageAccountType": {"value": "Standard_GRS"}}, "mode": "Incremental", + "whatIfSettings": {"resultFormat": "FullResourcePayloads"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group what-if + Connection: + - keep-alive + Content-Length: + - '452' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/deployments/mock-deployment/whatIf?api-version=2020-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 Aug 2020 21:16:43 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnRXaGF0SWZKb2ItQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZXSEFUOjVGSUY6NUZURU1QTEFURTp8QjY0RTIwRDVGNUQxMDhENi0xLTQyQjQ5NTZEOjJERDhCQToyRDQxNEI6MkQ4RTFBOjJEQzhFRTFCRTlBMDFDIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2020-06-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment group what-if + Connection: + - keep-alive + ParameterSetName: + - --resource-group --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnRXaGF0SWZKb2ItQ0xJOjVGVEVTVDo1RkRFUExPWU1FTlQ6NUZXSEFUOjVGSUY6NUZURU1QTEFURTp8QjY0RTIwRDVGNUQxMDhENi0xLTQyQjQ5NTZEOjJERDhCQToyRDQxNEI6MkQ4RTFBOjJEQzhFRTFCRTlBMDFDIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2020-06-01 + response: + body: + string: '{"status":"Succeeded","properties":{"changes":[{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002","changeType":"Ignore","before":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002","location":"westus","name":"cli-test-deploy-what-if-rg-deploy000002","type":"Microsoft.Resources/templateSpecs"},"after":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002","location":"westus","name":"cli-test-deploy-what-if-rg-deploy000002","type":"Microsoft.Resources/templateSpecs"}},{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0","changeType":"Ignore","before":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0","location":"westus","name":"cli-test-deploy-what-if-rg-deploy000002/1.0","type":"Microsoft.Resources/templateSpecs/versions"},"after":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-rg-deploy000002/versions/1.0","location":"westus","name":"cli-test-deploy-what-if-rg-deploy000002/1.0","type":"Microsoft.Resources/templateSpecs/versions"}},{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Storage/storageAccounts/storele7wnsppphwea","changeType":"Modify","before":{"apiVersion":"2019-04-01","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Storage/storageAccounts/storele7wnsppphwea","kind":"StorageV2","location":"westus","name":"storele7wnsppphwea","properties":{"accessTier":"Hot","encryption":{"keySource":"Microsoft.Storage"},"networkAcls":{"bypass":"AzureServices","defaultAction":"Allow"},"supportsHttpsTrafficOnly":true},"sku":{"name":"Standard_LRS"},"tags":{"costCenter":"Contoso/IT/PROD/123456"},"type":"Microsoft.Storage/storageAccounts"},"after":{"apiVersion":"2019-04-01","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Storage/storageAccounts/storele7wnsppphwea","kind":"StorageV2","location":"westus","name":"storele7wnsppphwea","properties":{"accessTier":"Hot","encryption":{"keySource":"Microsoft.Storage"},"networkAcls":{"bypass":"AzureServices","defaultAction":"Allow"},"supportsHttpsTrafficOnly":true},"sku":{"name":"Standard_GRS"},"tags":{"costCenter":"Contoso/IT/PROD/123456"},"type":"Microsoft.Storage/storageAccounts"},"delta":[{"path":"sku.name","propertyChangeType":"Modify","before":"Standard_LRS","after":"Standard_GRS"}]}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3863' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:16:59 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 +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_show_template_spec.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_show_template_spec.yaml new file mode 100644 index 00000000000..1aeb93f91d4 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_show_template_spec.yaml @@ -0,0 +1,341 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002'' + under resource group ''cli_test_template_specs000001'' was not found. For + more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:57.8272867Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:57.8272867Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-get-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '781' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:58.9473275Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.9473275Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts show + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:57.8272867Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.9473275Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-get-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts show + Connection: + - keep-alive + ParameterSetName: + - --template-spec + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:15:57.8272867Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:15:58.9473275Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-get-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:15:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-get-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 16 Sep 2020 14:16:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_deployment_ts.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_deployment_ts.yaml new file mode 100644 index 00000000000..5c7d2a5601a --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_deployment_ts.yaml @@ -0,0 +1,1518 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002'' + under resource group ''cli_test_template_specs_tenant_deploy000001'' was not + found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:57:08.6758354Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:57:08.6758354Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-sub-lvl-ts-deploy000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "eastus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"storageAccountName": {"type": "string", + "defaultValue": "armbuilddemo1801"}, "nestedRGName": {"type": "string", "defaultValue": + "cli_test_subscription_level_deployment"}}, "variables": {}, "resources": [{"type": + "Microsoft.Authorization/policyDefinitions", "name": "policy2", "apiVersion": + "2016-12-01", "properties": {"policyType": "Custom", "parameters": {}, "policyRule": + {"if": {"field": "location", "equals": "northeurope"}, "then": {"effect": "deny"}}}}, + {"type": "Microsoft.Authorization/policyAssignments", "name": "location-lock", + "apiVersion": "2016-12-01", "dependsOn": ["policy2"], "properties": {"scope": + "[subscription().id]", "policyDefinitionId": "[resourceId(''Microsoft.Authorization/policyDefinitions'', + ''policy2'')]"}}, {"type": "Microsoft.Resources/resourceGroups", "name": "[parameters(''nestedRGName'')]", + "apiVersion": "2018-05-01", "location": "WestUS", "properties": {}}, {"type": + "Microsoft.Resources/deployments", "name": "rg-nested6", "apiVersion": "2017-05-10", + "resourceGroup": "[parameters(''nestedRGName'')]", "dependsOn": ["[parameters(''nestedRGName'')]"], + "properties": {"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(''storageAccountName'')]", + "apiVersion": "2015-06-15", "location": "East US", "properties": {"accountType": + "Standard_LRS", "supportsHttpsTrafficOnly": true}}]}, "mode": "Incremental"}}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '1744' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:57:09.7710286Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:57:09.7710286Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountName\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"armbuilddemo1801\"\r\n + \ },\r\n \"nestedRGName\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"cli_test_subscription_level_deployment\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n + \ \"name\": \"policy2\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"properties\": {\r\n \"policyType\": \"Custom\",\r\n + \ \"parameters\": {},\r\n \"policyRule\": {\r\n \"if\": + {\r\n \"field\": \"location\",\r\n \"equals\": + \"northeurope\"\r\n },\r\n \"then\": {\r\n \"effect\": + \"deny\"\r\n }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.Authorization/policyAssignments\",\r\n + \ \"name\": \"location-lock\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"dependsOn\": [\r\n \"policy2\"\r\n ],\r\n + \ \"properties\": {\r\n \"scope\": \"[subscription().id]\",\r\n + \ \"policyDefinitionId\": \"[resourceId('Microsoft.Authorization/policyDefinitions', + 'policy2')]\"\r\n }\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/resourceGroups\",\r\n \"name\": \"[parameters('nestedRGName')]\",\r\n + \ \"apiVersion\": \"2018-05-01\",\r\n \"location\": \"WestUS\",\r\n + \ \"properties\": {}\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/deployments\",\r\n \"name\": \"rg-nested6\",\r\n + \ \"apiVersion\": \"2017-05-10\",\r\n \"resourceGroup\": + \"[parameters('nestedRGName')]\",\r\n \"dependsOn\": [\r\n \"[parameters('nestedRGName')]\"\r\n + \ ],\r\n \"properties\": {\r\n \"template\": {\r\n + \ \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": + {},\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n + \ \"name\": \"[parameters('storageAccountName')]\",\r\n \"apiVersion\": + \"2015-06-15\",\r\n \"location\": \"East US\",\r\n \"properties\": + {\r\n \"accountType\": \"Standard_LRS\",\r\n \"supportsHttpsTrafficOnly\": + true\r\n }\r\n }\r\n ]\r\n },\r\n + \ \"mode\": \"Incremental\"\r\n }\r\n }\r\n ]\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3460' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub validate + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15916' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:10 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 sub validate + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:57:09.7710286Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:57:09.7710286Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountName\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"armbuilddemo1801\"\r\n + \ },\r\n \"nestedRGName\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"cli_test_subscription_level_deployment\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n + \ \"name\": \"policy2\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"properties\": {\r\n \"policyType\": \"Custom\",\r\n + \ \"parameters\": {},\r\n \"policyRule\": {\r\n \"if\": + {\r\n \"field\": \"location\",\r\n \"equals\": + \"northeurope\"\r\n },\r\n \"then\": {\r\n \"effect\": + \"deny\"\r\n }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.Authorization/policyAssignments\",\r\n + \ \"name\": \"location-lock\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"dependsOn\": [\r\n \"policy2\"\r\n ],\r\n + \ \"properties\": {\r\n \"scope\": \"[subscription().id]\",\r\n + \ \"policyDefinitionId\": \"[resourceId('Microsoft.Authorization/policyDefinitions', + 'policy2')]\"\r\n }\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/resourceGroups\",\r\n \"name\": \"[parameters('nestedRGName')]\",\r\n + \ \"apiVersion\": \"2018-05-01\",\r\n \"location\": \"WestUS\",\r\n + \ \"properties\": {}\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/deployments\",\r\n \"name\": \"rg-nested6\",\r\n + \ \"apiVersion\": \"2017-05-10\",\r\n \"resourceGroup\": + \"[parameters('nestedRGName')]\",\r\n \"dependsOn\": [\r\n \"[parameters('nestedRGName')]\"\r\n + \ ],\r\n \"properties\": {\r\n \"template\": {\r\n + \ \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": + {},\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n + \ \"name\": \"[parameters('storageAccountName')]\",\r\n \"apiVersion\": + \"2015-06-15\",\r\n \"location\": \"East US\",\r\n \"properties\": + {\r\n \"accountType\": \"Standard_LRS\",\r\n \"supportsHttpsTrafficOnly\": + true\r\n }\r\n }\r\n ]\r\n },\r\n + \ \"mode\": \"Incremental\"\r\n }\r\n }\r\n ]\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3460' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + 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/subscription_level_parameters.json + response: + body: + string: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {\n /** comment1\n + \ comment2\n comment3\n **/\n // comment\n /** + comment **/\n \"storageAccountName\": {\n \"value\": \"armbuilddemo18221\" + \ // comment\n },\n \"nestedRGName\": {\n /** comment1\n comment2\n + \ comment3\n **/\n // comment\n /** comment **/\n \"value\": + \"cli_test_subscription_level_deployment\" /** comment **/\n /** comment1\n + \ comment2\n comment3\n **/\n // comment\n /** + comment **/\n }\n /** comment1\n comment2\n comment3\n + \ **/\n // comment\n /** comment **/\n }\n}" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - close + content-length: + - '743' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:11 GMT + etag: + - '"79cf9050f422e6c9fef2a7ec4857b9816421227463500c581f531a808d563754"' + expires: + - Thu, 20 Aug 2020 16:02:11 GMT + source-age: + - '189' + 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: + - 69e1f46e1a734a213ba477ea3e3ab0106c19d267 + x-frame-options: + - deny + x-github-request-id: + - 3CCC:2722:1B41FE:1FFA00:5F3E9C99 + x-served-by: + - cache-fty21383-FTY + x-timer: + - S1597939031.494620,VS0,VE1 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"location": "WestUS", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0"}, + "parameters": {"storageAccountName": {"value": "armbuilddemo18221"}, "nestedRGName": + {"value": "cli_test_subscription_level_deployment"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub validate + Connection: + - keep-alive + Content-Length: + - '488' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:12.4804376Z","duration":"PT0S","correlationId":"ba7cb99f-2de8-4aa7-bc5f-8e645df96544","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Storage/storageAccounts/armbuilddemo18221"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2884' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:12 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + ParameterSetName: + - -n --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15916' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:13 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 sub create + Connection: + - keep-alive + ParameterSetName: + - -n --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:57:09.7710286Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:57:09.7710286Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountName\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"armbuilddemo1801\"\r\n + \ },\r\n \"nestedRGName\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"cli_test_subscription_level_deployment\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n + \ \"name\": \"policy2\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"properties\": {\r\n \"policyType\": \"Custom\",\r\n + \ \"parameters\": {},\r\n \"policyRule\": {\r\n \"if\": + {\r\n \"field\": \"location\",\r\n \"equals\": + \"northeurope\"\r\n },\r\n \"then\": {\r\n \"effect\": + \"deny\"\r\n }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.Authorization/policyAssignments\",\r\n + \ \"name\": \"location-lock\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"dependsOn\": [\r\n \"policy2\"\r\n ],\r\n + \ \"properties\": {\r\n \"scope\": \"[subscription().id]\",\r\n + \ \"policyDefinitionId\": \"[resourceId('Microsoft.Authorization/policyDefinitions', + 'policy2')]\"\r\n }\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/resourceGroups\",\r\n \"name\": \"[parameters('nestedRGName')]\",\r\n + \ \"apiVersion\": \"2018-05-01\",\r\n \"location\": \"WestUS\",\r\n + \ \"properties\": {}\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/deployments\",\r\n \"name\": \"rg-nested6\",\r\n + \ \"apiVersion\": \"2017-05-10\",\r\n \"resourceGroup\": + \"[parameters('nestedRGName')]\",\r\n \"dependsOn\": [\r\n \"[parameters('nestedRGName')]\"\r\n + \ ],\r\n \"properties\": {\r\n \"template\": {\r\n + \ \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": + {},\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n + \ \"name\": \"[parameters('storageAccountName')]\",\r\n \"apiVersion\": + \"2015-06-15\",\r\n \"location\": \"East US\",\r\n \"properties\": + {\r\n \"accountType\": \"Standard_LRS\",\r\n \"supportsHttpsTrafficOnly\": + true\r\n }\r\n }\r\n ]\r\n },\r\n + \ \"mode\": \"Incremental\"\r\n }\r\n }\r\n ]\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3460' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "WestUS", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0"}, + "parameters": {"storageAccountName": {"value": "armbuilddemo18221"}, "nestedRGName": + {"value": "cli_test_subscription_level_deployment"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + Content-Length: + - '488' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003","name":"azure-cli-subscription_level_deployment000003","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:14.7562234Z","duration":"PT0S","correlationId":"b18d2fa1-4619-4378-bcc4-1a6c471ba98c","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Storage/storageAccounts/armbuilddemo18221"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3002' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:14 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: '{"location": "WestUS", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0"}, + "parameters": {"storageAccountName": {"value": "armbuilddemo18221"}, "nestedRGName": + {"value": "cli_test_subscription_level_deployment"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + Content-Length: + - '488' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003","name":"azure-cli-subscription_level_deployment000003","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-08-20T15:57:16.6016358Z","duration":"PT0.9864018S","correlationId":"0503364e-0ba4-4e71-93a5-9664ffbaa142","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003/operationStatuses/08586036678498623890?api-version=2020-06-01 + cache-control: + - no-cache + content-length: + - '2278' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:16 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 sub create + Connection: + - keep-alive + ParameterSetName: + - -n --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586036678498623890?api-version=2020-06-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:57:46 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 sub create + Connection: + - keep-alive + ParameterSetName: + - -n --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586036678498623890?api-version=2020-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:17 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 sub create + Connection: + - keep-alive + ParameterSetName: + - -n --location --template-spec --parameters + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003","name":"azure-cli-subscription_level_deployment000003","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:57.1995992Z","duration":"PT41.5843652S","correlationId":"0503364e-0ba4-4e71-93a5-9664ffbaa142","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Storage/storageAccounts/armbuilddemo18221"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2840' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:17 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 sub show + Connection: + - keep-alive + ParameterSetName: + - -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003","name":"azure-cli-subscription_level_deployment000003","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:57.1995992Z","duration":"PT41.5843652S","correlationId":"0503364e-0ba4-4e71-93a5-9664ffbaa142","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Storage/storageAccounts/armbuilddemo18221"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2840' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:19 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 sub export + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/exportTemplate?api-version=2020-06-01 + response: + body: + string: '{"template":{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{"storageAccountName":{"defaultValue":"armbuilddemo1801","type":"String"},"nestedRGName":{"defaultValue":"cli_test_subscription_level_deployment","type":"String"}},"variables":{},"resources":[{"type":"Microsoft.Authorization/policyDefinitions","apiVersion":"2016-12-01","name":"policy2","properties":{"policyType":"Custom","parameters":{},"policyRule":{"if":{"field":"location","equals":"northeurope"},"then":{"effect":"deny"}}}},{"type":"Microsoft.Authorization/policyAssignments","apiVersion":"2016-12-01","name":"location-lock","dependsOn":["policy2"],"properties":{"scope":"[subscription().id]","policyDefinitionId":"[resourceId(''Microsoft.Authorization/policyDefinitions'', + ''policy2'')]"}},{"type":"Microsoft.Resources/resourceGroups","apiVersion":"2018-05-01","name":"[parameters(''nestedRGName'')]","location":"WestUS","properties":{}},{"type":"Microsoft.Resources/deployments","apiVersion":"2017-05-10","name":"rg-nested6","dependsOn":["[parameters(''nestedRGName'')]"],"properties":{"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(''storageAccountName'')]","apiVersion":"2015-06-15","location":"East + US","properties":{"accountType":"Standard_LRS","supportsHttpsTrafficOnly":true}}]},"mode":"Incremental"},"resourceGroup":"[parameters(''nestedRGName'')]"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1592' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:19 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment operation sub list + Connection: + - keep-alive + ParameterSetName: + - -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/operations?api-version=2020-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003/operations/329EE474E6D6C89B","operationId":"329EE474E6D6C89B","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:55.681714Z","duration":"PT34.6674743S","trackingId":"35c587cf-c59c-488b-94ed-9e51c5358bb4","serviceRequestId":"56cdfcbd-bb1c-4c3c-b74d-c7b32318692b","statusCode":"OK","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003/operations/AB73B60C58049248","operationId":"AB73B60C58049248","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:20.706402Z","duration":"PT2.3974458S","trackingId":"3eef41be-7595-494c-99cf-26f74241a8b8","serviceRequestId":"f4adb327-ca7f-4546-b73c-e89b968442fe","statusCode":"Created","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003/operations/E0AC39399CA5D988","operationId":"E0AC39399CA5D988","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:19.8868294Z","duration":"PT0.3881352S","trackingId":"75b16f45-16cd-46e5-8129-162b35c981ea","serviceRequestId":"eastus:aef12f1c-eda2-4589-a367-03e2b1bbb9ff","statusCode":"Created","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003/operations/02C83B583A6FE177","operationId":"02C83B583A6FE177","properties":{"provisioningOperation":"Create","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:18.9693199Z","duration":"PT0.6603637S","trackingId":"904b7d40-26de-4ccc-ac47-17d08b98204d","serviceRequestId":"eastus:356702c2-b7a2-44d5-9d55-d9f82745edac","statusCode":"Created","targetResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000003/operations/08586036678498623890","operationId":"08586036678498623890","properties":{"provisioningOperation":"EvaluateDeploymentOutput","provisioningState":"Succeeded","timestamp":"2020-08-20T15:57:56.9698113Z","duration":"PT0.820013S","trackingId":"08b510d6-f8ce-4842-bd64-8edf75ae6b4e","statusCode":"OK"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '3474' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:19 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 sub create + Connection: + - keep-alive + ParameterSetName: + - -n --location --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","Norway East","UAE North","West Central US","West Europe","West + US 2","West US","South Central US","South Africa North"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15916' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:21 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 sub create + Connection: + - keep-alive + ParameterSetName: + - -n --location --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"eastus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-20T15:57:09.7710286Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-20T15:57:09.7710286Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountName\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"armbuilddemo1801\"\r\n + \ },\r\n \"nestedRGName\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"cli_test_subscription_level_deployment\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n + \ \"name\": \"policy2\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"properties\": {\r\n \"policyType\": \"Custom\",\r\n + \ \"parameters\": {},\r\n \"policyRule\": {\r\n \"if\": + {\r\n \"field\": \"location\",\r\n \"equals\": + \"northeurope\"\r\n },\r\n \"then\": {\r\n \"effect\": + \"deny\"\r\n }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.Authorization/policyAssignments\",\r\n + \ \"name\": \"location-lock\",\r\n \"apiVersion\": \"2016-12-01\",\r\n + \ \"dependsOn\": [\r\n \"policy2\"\r\n ],\r\n + \ \"properties\": {\r\n \"scope\": \"[subscription().id]\",\r\n + \ \"policyDefinitionId\": \"[resourceId('Microsoft.Authorization/policyDefinitions', + 'policy2')]\"\r\n }\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/resourceGroups\",\r\n \"name\": \"[parameters('nestedRGName')]\",\r\n + \ \"apiVersion\": \"2018-05-01\",\r\n \"location\": \"WestUS\",\r\n + \ \"properties\": {}\r\n },\r\n {\r\n \"type\": + \"Microsoft.Resources/deployments\",\r\n \"name\": \"rg-nested6\",\r\n + \ \"apiVersion\": \"2017-05-10\",\r\n \"resourceGroup\": + \"[parameters('nestedRGName')]\",\r\n \"dependsOn\": [\r\n \"[parameters('nestedRGName')]\"\r\n + \ ],\r\n \"properties\": {\r\n \"template\": {\r\n + \ \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": + {},\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n + \ \"name\": \"[parameters('storageAccountName')]\",\r\n \"apiVersion\": + \"2015-06-15\",\r\n \"location\": \"East US\",\r\n \"properties\": + {\r\n \"accountType\": \"Standard_LRS\",\r\n \"supportsHttpsTrafficOnly\": + true\r\n }\r\n }\r\n ]\r\n },\r\n + \ \"mode\": \"Incremental\"\r\n }\r\n }\r\n ]\r\n + \ }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3460' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "WestUS", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0"}, + "parameters": {"storageAccountName": {"value": "armbuilddemo18221"}, "nestedRGName": + {"value": "cli_test_subscription_level_deployment"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + Content-Length: + - '488' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n --location --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000004","name":"azure-cli-subscription_level_deployment000004","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-20T15:58:22.4908916Z","duration":"PT0S","correlationId":"3fe55b5b-f51e-4283-901d-596e2df6120f","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Storage/storageAccounts/armbuilddemo18221"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3002' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:22 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: '{"location": "WestUS", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0"}, + "parameters": {"storageAccountName": {"value": "armbuilddemo18221"}, "nestedRGName": + {"value": "cli_test_subscription_level_deployment"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + Content-Length: + - '488' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n --location --template-spec --parameters --no-wait + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000004","name":"azure-cli-subscription_level_deployment000004","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-08-20T15:58:24.3534761Z","duration":"PT1.0748634S","correlationId":"3382d22e-4cde-40f5-83f4-3185f03f6662","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000004/operationStatuses/08586036677821990209?api-version=2020-06-01 + cache-control: + - no-cache + content-length: + - '2278' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:23 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 sub cancel + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/cancel?api-version=2020-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Thu, 20 Aug 2020 15:58:25 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: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub show + Connection: + - keep-alive + ParameterSetName: + - -n + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/azure-cli-subscription_level_deployment000004","name":"azure-cli-subscription_level_deployment000004","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1013067532690748919","parameters":{"storageAccountName":{"type":"String","value":"armbuilddemo18221"},"nestedRGName":{"type":"String","value":"cli_test_subscription_level_deployment"}},"mode":"Incremental","provisioningState":"Canceled","timestamp":"2020-08-20T15:58:25.5082862Z","duration":"PT2.2296735S","correlationId":"3382d22e-4cde-40f5-83f4-3185f03f6662","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]},{"resourceType":"policyAssignments","locations":[null]}]},{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]},{"resourceType":"deployments","locations":[null]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy2","resourceType":"Microsoft.Authorization/policyDefinitions","resourceName":"policy2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyAssignments/location-lock","resourceType":"Microsoft.Authorization/policyAssignments","resourceName":"location-lock"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment","resourceType":"Microsoft.Resources/resourceGroups","resourceName":"cli_test_subscription_level_deployment"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_subscription_level_deployment/providers/Microsoft.Resources/deployments/rg-nested6","resourceType":"Microsoft.Resources/deployments","resourceName":"rg-nested6"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2278' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 15:58:26 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: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.10.1 (MSI) + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs_tenant_deploy000001/providers/Microsoft.Resources/templateSpecs/cli-test-sub-lvl-ts-deploy000002?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 20 Aug 2020 15:58:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_what_if_ts.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_what_if_ts.yaml new file mode 100644 index 00000000000..1c0ee4800bb --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_what_if_ts.yaml @@ -0,0 +1,798 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002'' + under resource group ''cli_test_deployment_what_if_template_specs000001'' + was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:26:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:26:49.210836Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:26:49.210836Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-deploy-what-if-sub-deploy000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '717' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:26:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"denyLocation": {"type": "string", + "defaultValue": "northeurope"}}, "variables": {"policyDefinitionName": "policy-for-what-if-test"}, + "resources": [{"name": "[variables(''policyDefinitionName'')]", "type": "Microsoft.Authorization/policyDefinitions", + "apiVersion": "2018-05-01", "properties": {"policyType": "Custom", "policyRule": + {"if": {"field": "location", "equals": "[parameters(''denyLocation'')]"}, "then": + {"effect": "deny"}}}}], "outputs": {"policyDefinitionId": {"type": "string", + "value": "[resourceId(''Microsoft.Authorization/policyDefinitions'', variables(''policyDefinitionName''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '801' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:26:50.5859276Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:26:50.5859276Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"denyLocation\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"northeurope\"\r\n + \ }\r\n },\r\n \"variables\": {\r\n \"policyDefinitionName\": + \"policy-for-what-if-test\"\r\n },\r\n \"resources\": [\r\n {\r\n + \ \"name\": \"[variables('policyDefinitionName')]\",\r\n \"type\": + \"Microsoft.Authorization/policyDefinitions\",\r\n \"apiVersion\": + \"2018-05-01\",\r\n \"properties\": {\r\n \"policyType\": + \"Custom\",\r\n \"policyRule\": {\r\n \"if\": {\r\n + \ \"field\": \"location\",\r\n \"equals\": \"[parameters('denyLocation')]\"\r\n + \ },\r\n \"then\": {\r\n \"effect\": + \"deny\"\r\n }\r\n }\r\n }\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"policyDefinitionId\": {\r\n + \ \"type\": \"string\",\r\n \"value\": \"[resourceId('Microsoft.Authorization/policyDefinitions', + variables('policyDefinitionName'))]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1871' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:26:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15846' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:26:51 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 sub create + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:26:50.5859276Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:26:50.5859276Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"denyLocation\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"northeurope\"\r\n + \ }\r\n },\r\n \"variables\": {\r\n \"policyDefinitionName\": + \"policy-for-what-if-test\"\r\n },\r\n \"resources\": [\r\n {\r\n + \ \"name\": \"[variables('policyDefinitionName')]\",\r\n \"type\": + \"Microsoft.Authorization/policyDefinitions\",\r\n \"apiVersion\": + \"2018-05-01\",\r\n \"properties\": {\r\n \"policyType\": + \"Custom\",\r\n \"policyRule\": {\r\n \"if\": {\r\n + \ \"field\": \"location\",\r\n \"equals\": \"[parameters('denyLocation')]\"\r\n + \ },\r\n \"then\": {\r\n \"effect\": + \"deny\"\r\n }\r\n }\r\n }\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"policyDefinitionId\": {\r\n + \ \"type\": \"string\",\r\n \"value\": \"[resourceId('Microsoft.Authorization/policyDefinitions', + variables('policyDefinitionName'))]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1871' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:26:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0"}, + "parameters": {}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + Content-Length: + - '367' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1669246125929096641","parameters":{"denyLocation":{"type":"String","value":"northeurope"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-05T21:26:53.5008492Z","duration":"PT0S","correlationId":"8f786f5a-796e-4d07-8204-2f15560e9d76","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy-for-what-if-test"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1085' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:26:53 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: '{"location": "westus", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0"}, + "parameters": {}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub create + Connection: + - keep-alive + Content-Length: + - '367' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1669246125929096641","parameters":{"denyLocation":{"type":"String","value":"northeurope"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-08-05T21:26:55.1582045Z","duration":"PT1.2432783S","correlationId":"9fd4e37b-2700-4cf2-999d-408df37b4be8","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]}]}],"dependencies":[]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/1/operationStatuses/08586049440715626818?api-version=2020-06-01 + cache-control: + - no-cache + content-length: + - '932' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:26:55 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 sub create + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08586049440715626818?api-version=2020-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:27:25 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 sub create + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/1","name":"1","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateLink":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0","contentVersion":"1.0.0.0"},"templateHash":"1669246125929096641","parameters":{"denyLocation":{"type":"String","value":"northeurope"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-08-05T21:26:57.4466926Z","duration":"PT3.5317664S","correlationId":"9fd4e37b-2700-4cf2-999d-408df37b4be8","providers":[{"namespace":"Microsoft.Authorization","resourceTypes":[{"resourceType":"policyDefinitions","locations":[null]}]}],"dependencies":[],"outputs":{"policyDefinitionId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy-for-what-if-test"}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy-for-what-if-test"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1279' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:27:26 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 sub what-if + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources","namespace":"Microsoft.Resources","authorization":{"applicationId":"3b990c8b-9607-4c2a-8b04-1d41985facca"},"resourceTypes":[{"resourceType":"tenants","locations":[],"apiVersions":["2020-01-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"operationresults","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"notifyResourceJobs","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01"],"capabilities":"None"},{"resourceType":"tags","locations":[],"apiVersions":["2019-10-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01"],"capabilities":"SupportsExtension"},{"resourceType":"checkPolicyCompliance","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"capabilities":"None"},{"resourceType":"providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"checkresourcename","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"calculateTemplateHash","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions","locations":[],"apiVersions":["2019-10-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/resources","locations":[],"apiVersions":["2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/providers","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/operationresults","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsLocation"},{"resourceType":"subscriptions/resourceGroups","locations":["Central + US","East Asia","Southeast Asia","East US","East US 2","West US","West US + 2","North Central US","South Central US","West Central US","North Europe","West + Europe","Japan East","Japan West","Brazil South","Australia Southeast","Australia + East","West India","South India","Central India","Canada Central","Canada + East","UK South","UK West","Korea Central","Korea South","France Central","South + Africa North","UAE North","Australia Central","Switzerland North","Germany + West Central","Norway East","East US 2 EUAP","Central US EUAP"],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"subscriptions/resourcegroups/resources","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/locations","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2016-06-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagnames","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"subscriptions/tagNames/tagValues","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-08-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"deployments/operations","locations":[],"apiVersions":["2020-06-01","2019-09-01","2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"None"},{"resourceType":"links","locations":[],"apiVersions":["2019-05-01","2019-04-01","2019-03-01","2018-11-01","2018-09-01","2018-08-01","2018-07-01","2018-05-01","2018-02-01","2018-01-01","2017-08-01","2017-06-01","2017-05-10","2017-05-01","2017-03-01","2016-09-01","2016-07-01","2016-06-01","2016-02-01","2015-11-01","2015-01-01","2014-04-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2016-06-01"},{"profileVersion":"2019-03-01-hybrid","apiVersion":"2018-05-01"}],"capabilities":"SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2015-01-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-01-01"}],"capabilities":"None"},{"resourceType":"deploymentScripts","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"SupportsTags, + SupportsLocation"},{"resourceType":"deploymentScripts/logs","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"locations/deploymentScriptOperationResults","locations":["East + Asia","Southeast Asia","Australia East","Brazil South","Canada Central","East + US 2","East US","Central US","North Central US","UK South","Central India","South + India","Japan East","Korea Central","North Europe","West Central US","West + Europe","West US 2","West US","South Central US","Canada East","Central US + EUAP","East US 2 EUAP"],"apiVersions":["2019-10-01-preview"],"capabilities":"None"},{"resourceType":"templateSpecs","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"templateSpecs/versions","locations":["East + Asia","Southeast Asia","Australia East","Australia Central","Australia Central + 2","Australia Southeast","Brazil South","Canada Central","Canada East","Switzerland + North","Central US EUAP","Germany West Central","East US 2","East US","Central + US","North Central US","East US 2 EUAP","France Central","UK South","UK West","Central + India","West India","South India","Japan East","Japan West","Korea Central","Korea + South","North Europe","UAE North","West Central US","West Europe","West US + 2","West US","South Central US"],"apiVersions":["2019-06-01-preview"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationFree"}' + headers: + cache-control: + - no-cache + content-length: + - '15846' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:27:27 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 sub what-if + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-08-05T21:26:50.5859276Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-08-05T21:26:50.5859276Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"denyLocation\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"northeurope\"\r\n + \ }\r\n },\r\n \"variables\": {\r\n \"policyDefinitionName\": + \"policy-for-what-if-test\"\r\n },\r\n \"resources\": [\r\n {\r\n + \ \"name\": \"[variables('policyDefinitionName')]\",\r\n \"type\": + \"Microsoft.Authorization/policyDefinitions\",\r\n \"apiVersion\": + \"2018-05-01\",\r\n \"properties\": {\r\n \"policyType\": + \"Custom\",\r\n \"policyRule\": {\r\n \"if\": {\r\n + \ \"field\": \"location\",\r\n \"equals\": \"[parameters('denyLocation')]\"\r\n + \ },\r\n \"then\": {\r\n \"effect\": + \"deny\"\r\n }\r\n }\r\n }\r\n }\r\n + \ ],\r\n \"outputs\": {\r\n \"policyDefinitionId\": {\r\n + \ \"type\": \"string\",\r\n \"value\": \"[resourceId('Microsoft.Authorization/policyDefinitions', + variables('policyDefinitionName'))]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1871' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:27:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"templateLink": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_deployment_what_if_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-deploy-what-if-sub-deploy000002/versions/1.0"}, + "parameters": {"denyLocation": {"value": "westeurope"}}, "mode": "Incremental", + "whatIfSettings": {"resultFormat": "FullResourcePayloads"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub what-if + Connection: + - keep-alive + Content-Length: + - '466' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --location --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/mock-deployment/whatIf?api-version=2020-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 Aug 2020 21:27:28 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnRXaGF0SWZKb2ItLTEtODM1Q0REMUI6MkRGOTgzOjJENDg3QzoyREE4NUE6MkQyQUQ2NkEyRTA1RDAiLCJqb2JMb2NhdGlvbiI6Indlc3R1cyJ9?api-version=2020-06-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - deployment sub what-if + Connection: + - keep-alive + ParameterSetName: + - --location --template-spec --parameters --no-pretty-print + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 + Azure-SDK-For-Python AZURECLI/2.10.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnRXaGF0SWZKb2ItLTEtODM1Q0REMUI6MkRGOTgzOjJENDg3QzoyREE4NUE6MkQyQUQ2NkEyRTA1RDAiLCJqb2JMb2NhdGlvbiI6Indlc3R1cyJ9?api-version=2020-06-01 + response: + body: + string: '{"status":"Succeeded","properties":{"changes":[{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy-for-what-if-test","changeType":"Modify","before":{"apiVersion":"2018-05-01","id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy-for-what-if-test","name":"policy-for-what-if-test","properties":{"mode":"Indexed","policyRule":{"if":{"equals":"northeurope","field":"location"},"then":{"effect":"deny"}},"policyType":"Custom"},"type":"Microsoft.Authorization/policyDefinitions"},"after":{"apiVersion":"2018-05-01","id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policyDefinitions/policy-for-what-if-test","name":"policy-for-what-if-test","properties":{"mode":"Indexed","policyRule":{"if":{"equals":"westeurope","field":"location"},"then":{"effect":"deny"}},"policyType":"Custom"},"type":"Microsoft.Authorization/policyDefinitions"},"delta":[{"path":"properties.policyRule.if.equals","propertyChangeType":"Modify","before":"northeurope","after":"westeurope"}]}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1139' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Aug 2020 21:27:44 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 +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_update_template_specs.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_update_template_specs.yaml new file mode 100644 index 00000000000..d60068385d9 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_update_template_specs.yaml @@ -0,0 +1,791 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002'' + under resource group ''cli_test_template_specs000001'' was not found. For + more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '341' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:04.4617274Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:04.4617274Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-update-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: '{"location": "westus", "properties": {"artifacts": [], "template": {"$schema": + "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts create + Connection: + - keep-alive + Content-Length: + - '781' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -l -f + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:05.6067825Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:05.6067825Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts update + Connection: + - keep-alive + ParameterSetName: + - -s --display-name --description --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:04.4617274Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:05.6067825Z\"\r\n + \ },\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-update-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"description": "AzCLI test root template + spec", "displayName": "create-spec000003"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts update + Connection: + - keep-alive + Content-Length: + - '125' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -s --display-name --description --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:04.4617274Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:06.6159216Z\"\r\n + \ },\r\n \"properties\": {\r\n \"displayName\": \"create-spec000003\",\r\n + \ \"description\": \"AzCLI test root template spec\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-update-template-spec000002\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '819' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: + - ts update + Connection: + - keep-alive + ParameterSetName: + - -s --version-description --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:05.6067825Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:05.6067825Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1817' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"description": "AzCLI test version + of root template spec", "template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "defaultValue": + "[resourceGroup().location]", "metadata": {"description": "Location for the + network security group."}}, "name": {"type": "string", "metadata": {"description": + "Name of the network security group."}}}, "variables": {}, "resources": [{"type": + "Microsoft.Network/networkSecurityGroups", "name": "[parameters(''name'')]", + "apiVersion": "2015-06-15", "location": "[parameters(''location'')]", "properties": + {"securityRules": []}, "dependsOn": []}], "outputs": {"NewNSG": {"type": "object", + "value": "[reference(parameters(''name''))]"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts update + Connection: + - keep-alive + Content-Length: + - '823' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -s --version-description --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:05.6067825Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:07.3918175Z\"\r\n + \ },\r\n \"properties\": {\r\n \"description\": \"AzCLI test version of + root template spec\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1859' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: + - ts update + Connection: + - keep-alive + ParameterSetName: + - -g -n -v -f --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:05.6067825Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:07.3918175Z\"\r\n + \ },\r\n \"properties\": {\r\n \"description\": \"AzCLI test version of + root template spec\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"location\": + {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"[resourceGroup().location]\",\r\n + \ \"metadata\": {\r\n \"description\": \"Location for the + network security group.\"\r\n }\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"metadata\": {\r\n \"description\": + \"Name of the network security group.\"\r\n }\r\n }\r\n },\r\n + \ \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"name\": \"[parameters('name')]\",\r\n + \ \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"securityRules\": []\r\n },\r\n + \ \"dependsOn\": []\r\n }\r\n ],\r\n \"outputs\": + {\r\n \"NewNSG\": {\r\n \"type\": \"object\",\r\n \"value\": + \"[reference(parameters('name'))]\"\r\n }\r\n }\r\n }\r\n },\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1859' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"artifacts": [{"path": "artifacts\\createResourceGroup.json", + "kind": "template", "template": {"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"rgName": {"type": "string"}, "rgLocation": + {"type": "string"}}, "variables": {}, "resources": [{"type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2019-10-01", "name": "[parameters(''rgName'')]", "location": + "[parameters(''rgLocation'')]", "properties": {}}], "outputs": {}}}, {"path": + "artifacts\\createKeyVault.json", "kind": "template", "template": {"$schema": + "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"keyVaultName": {"type": "string"}, + "location": {"type": "string", "defaultValue": "[resourceGroup().location]"}, + "skuName": {"type": "string", "defaultValue": "standard"}, "tenantId": {"type": + "string", "defaultValue": "[subscription().tenantId]"}, "aadObjectId": {"type": + "string", "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69"}}, "variables": + {}, "resources": [{"type": "Microsoft.KeyVault/vaults", "name": "[parameters(''keyVaultName'')]", + "apiVersion": "2018-02-14", "location": "[parameters(''location'')]", "properties": + {"tenantId": "[parameters(''tenantId'')]", "accessPolicies": [{"tenantId": "[parameters(''tenantId'')]", + "objectId": "[parameters(''aadObjectId'')]", "permissions": {"keys": ["encrypt", + "decrypt", "wrapKey", "unwrapKey", "sign", "verify", "get", "list", "create", + "update", "import", "delete", "backup", "restore", "recover", "purge"], "secrets": + ["get", "list", "set", "delete", "backup", "restore", "recover", "purge"], "certificates": + ["get", "list", "delete", "create", "import", "update", "managecontacts", "getissuers", + "listissuers", "setissuers", "deleteissuers", "manageissuers", "recover", "purge"]}}], + "sku": {"name": "[parameters(''skuName'')]", "family": "A"}, "networkAcls": + {"defaultAction": "Allow", "bypass": "AzureServices"}}}], "outputs": {}}}, {"path": + "artifacts\\createKeyVaultWithSecret.json", "kind": "template", "template": + {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"keyVaultName": {"type": "string"}, + "location": {"type": "string", "defaultValue": "[resourceGroup().location]"}, + "skuName": {"type": "string", "defaultValue": "standard"}, "tenantId": {"type": + "string", "defaultValue": "[subscription().tenantId]"}, "aadObjectId": {"type": + "string", "defaultValue": "177f56a0-9e41-4008-a321-d3676aae9c69"}}, "variables": + {}, "resources": [{"type": "Microsoft.Resources/deployments", "apiVersion": + "2019-10-01", "name": "keyVault", "properties": {"mode": "Incremental", "templateLink": + {"relativePath": "createKeyVault.json", "contentVersion": "1.0.0.0"}, "parameters": + {"keyVaultName": {"value": "[parameters(''keyVaultName'')]"}, "location": {"value": + "[parameters(''location'')]"}, "skuName": {"value": "[parameters(''skuName'')]"}, + "tenantId": {"value": "[parameters(''tenantId'')]"}, "aadObjectId": {"value": + "[parameters(''aadObjectId'')]"}}}}, {"type": "Microsoft.KeyVault/vaults/secrets", + "apiVersion": "2018-02-14", "name": "[concat(parameters(''keyVaultName''), ''/mySecret'')]", + "location": "[parameters(''location'')]", "dependsOn": ["keyVault"], "properties": + {"value": "mySecretValue"}}], "outputs": {}}}], "description": "AzCLI test version + of root template spec", "template": {"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"rgName": {"type": "string"}, "rgLocation": + {"type": "string"}, "keyVaultName": {"type": "string"}}, "variables": {}, "resources": + [{"type": "Microsoft.Resources/deployments", "apiVersion": "2019-10-01", "name": + "deploymentRg", "location": "[parameters(''rgLocation'')]", "properties": {"mode": + "Incremental", "templateLink": {"relativePath": "artifacts/createResourceGroup.json", + "contentVersion": "1.0.0.0"}, "parameters": {"rgName": {"value": "[parameters(''rgName'')]"}, + "rgLocation": {"value": "[parameters(''rgLocation'')]"}}}}, {"type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", "name": "keyVaultAndSecret", "resourceGroup": "[parameters(''rgName'')]", + "dependsOn": ["deploymentRg"], "properties": {"mode": "Incremental", "templateLink": + {"relativePath": "artifacts/createKeyVaultWithSecret.json", "contentVersion": + "1.0.0.0"}, "parameters": {"keyVaultName": {"value": "[parameters(''keyVaultName'')]"}}}}], + "outputs": {}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ts update + Connection: + - keep-alive + Content-Length: + - '4596' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -v -f --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0?api-version=2019-06-01-preview + response: + body: + string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\": + \"daetienn@microsoft.com\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\": + \"2020-09-16T14:16:05.6067825Z\",\r\n \"lastModifiedBy\": \"daetienn@microsoft.com\",\r\n + \ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-09-16T14:16:08.1026586Z\"\r\n + \ },\r\n \"properties\": {\r\n \"artifacts\": [\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"rgName\": {\r\n \"type\": \"string\"\r\n },\r\n + \ \"rgLocation\": {\r\n \"type\": \"string\"\r\n }\r\n + \ },\r\n \"variables\": {},\r\n \"resources\": [\r\n + \ {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"[parameters('rgName')]\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {}\r\n }\r\n ],\r\n \"outputs\": {}\r\n },\r\n + \ \"path\": \"artifacts\\\\createResourceGroup.json\",\r\n \"kind\": + \"template\"\r\n },\r\n {\r\n \"template\": {\r\n \"$schema\": + \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.KeyVault/vaults\",\r\n + \ \"name\": \"[parameters('keyVaultName')]\",\r\n \"apiVersion\": + \"2018-02-14\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"properties\": {\r\n \"tenantId\": \"[parameters('tenantId')]\",\r\n + \ \"accessPolicies\": [\r\n {\r\n \"tenantId\": + \"[parameters('tenantId')]\",\r\n \"objectId\": \"[parameters('aadObjectId')]\",\r\n + \ \"permissions\": {\r\n \"keys\": + [\r\n \"encrypt\",\r\n \"decrypt\",\r\n + \ \"wrapKey\",\r\n \"unwrapKey\",\r\n + \ \"sign\",\r\n \"verify\",\r\n + \ \"get\",\r\n \"list\",\r\n + \ \"create\",\r\n \"update\",\r\n + \ \"import\",\r\n \"delete\",\r\n + \ \"backup\",\r\n \"restore\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ],\r\n \"secrets\": [\r\n \"get\",\r\n + \ \"list\",\r\n \"set\",\r\n + \ \"delete\",\r\n \"backup\",\r\n + \ \"restore\",\r\n \"recover\",\r\n + \ \"purge\"\r\n ],\r\n \"certificates\": + [\r\n \"get\",\r\n \"list\",\r\n + \ \"delete\",\r\n \"create\",\r\n + \ \"import\",\r\n \"update\",\r\n + \ \"managecontacts\",\r\n \"getissuers\",\r\n + \ \"listissuers\",\r\n \"setissuers\",\r\n + \ \"deleteissuers\",\r\n \"manageissuers\",\r\n + \ \"recover\",\r\n \"purge\"\r\n + \ ]\r\n }\r\n }\r\n + \ ],\r\n \"sku\": {\r\n \"name\": + \"[parameters('skuName')]\",\r\n \"family\": \"A\"\r\n },\r\n + \ \"networkAcls\": {\r\n \"defaultAction\": + \"Allow\",\r\n \"bypass\": \"AzureServices\"\r\n }\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVault.json\",\r\n + \ \"kind\": \"template\"\r\n },\r\n {\r\n \"template\": + {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n + \ \"keyVaultName\": {\r\n \"type\": \"string\"\r\n + \ },\r\n \"location\": {\r\n \"type\": \"string\",\r\n + \ \"defaultValue\": \"[resourceGroup().location]\"\r\n },\r\n + \ \"skuName\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": + \"standard\"\r\n },\r\n \"tenantId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"[subscription().tenantId]\"\r\n + \ },\r\n \"aadObjectId\": {\r\n \"type\": + \"string\",\r\n \"defaultValue\": \"177f56a0-9e41-4008-a321-d3676aae9c69\"\r\n + \ }\r\n },\r\n \"variables\": {},\r\n \"resources\": + [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVault\",\r\n + \ \"properties\": {\r\n \"mode\": \"Incremental\",\r\n + \ \"templateLink\": {\r\n \"relativePath\": + \"createKeyVault.json\",\r\n \"contentVersion\": \"1.0.0.0\"\r\n + \ },\r\n \"parameters\": {\r\n \"keyVaultName\": + {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n },\r\n + \ \"location\": {\r\n \"value\": \"[parameters('location')]\"\r\n + \ },\r\n \"skuName\": {\r\n \"value\": + \"[parameters('skuName')]\"\r\n },\r\n \"tenantId\": + {\r\n \"value\": \"[parameters('tenantId')]\"\r\n },\r\n + \ \"aadObjectId\": {\r\n \"value\": \"[parameters('aadObjectId')]\"\r\n + \ }\r\n }\r\n }\r\n },\r\n + \ {\r\n \"type\": \"Microsoft.KeyVault/vaults/secrets\",\r\n + \ \"apiVersion\": \"2018-02-14\",\r\n \"name\": \"[concat(parameters('keyVaultName'), + '/mySecret')]\",\r\n \"location\": \"[parameters('location')]\",\r\n + \ \"dependsOn\": [\r\n \"keyVault\"\r\n ],\r\n + \ \"properties\": {\r\n \"value\": \"mySecretValue\"\r\n + \ }\r\n }\r\n ],\r\n \"outputs\": + {}\r\n },\r\n \"path\": \"artifacts\\\\createKeyVaultWithSecret.json\",\r\n + \ \"kind\": \"template\"\r\n }\r\n ],\r\n \"description\": + \"AzCLI test version of root template spec\",\r\n \"template\": {\r\n \"$schema\": + \"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#\",\r\n + \ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"rgName\": + {\r\n \"type\": \"string\"\r\n },\r\n \"rgLocation\": + {\r\n \"type\": \"string\"\r\n },\r\n \"keyVaultName\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": + {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"deploymentRg\",\r\n + \ \"location\": \"[parameters('rgLocation')]\",\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createResourceGroup.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"rgName\": {\r\n \"value\": \"[parameters('rgName')]\"\r\n + \ },\r\n \"rgLocation\": {\r\n \"value\": + \"[parameters('rgLocation')]\"\r\n }\r\n }\r\n }\r\n + \ },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n + \ \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"keyVaultAndSecret\",\r\n + \ \"resourceGroup\": \"[parameters('rgName')]\",\r\n \"dependsOn\": + [\r\n \"deploymentRg\"\r\n ],\r\n \"properties\": + {\r\n \"mode\": \"Incremental\",\r\n \"templateLink\": + {\r\n \"relativePath\": \"artifacts/createKeyVaultWithSecret.json\",\r\n + \ \"contentVersion\": \"1.0.0.0\"\r\n },\r\n \"parameters\": + {\r\n \"keyVaultName\": {\r\n \"value\": \"[parameters('keyVaultName')]\"\r\n + \ }\r\n }\r\n }\r\n }\r\n ],\r\n + \ \"outputs\": {}\r\n }\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002/versions/1.0\",\r\n + \ \"type\": \"Microsoft.Resources/templateSpecs/versions\",\r\n \"name\": + \"1.0\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '9426' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 14:16:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + 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: + - ts delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --template-spec --yes + User-Agent: + - python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-update-template-spec000002?api-version=2019-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 16 Sep 2020 14:16:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/template_spec_with_artifacts.json b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/template_spec_with_artifacts.json new file mode 100644 index 00000000000..f219a707e87 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/template_spec_with_artifacts.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "rgName": { + "type": "string" + }, + "rgLocation": { + "type": "string" + }, + "keyVaultName": { + "type": "string", + } + }, + "variables": {}, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "deploymentRg", + "location": "[parameters('rgLocation')]", + "properties": { + "mode": "Incremental", + "templateLink": { + "relativePath":"artifacts/createResourceGroup.json", + "contentVersion":"1.0.0.0" + }, + "parameters": { + "rgName":{"value": "[parameters('rgName')]"}, + "rgLocation":{"value": "[parameters('rgLocation')]"} + } + } + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "keyVaultAndSecret", + "resourceGroup": "[parameters('rgName')]", + "dependsOn": [ + "deploymentRg" + ], + "properties": { + "mode": "Incremental", + "templateLink": { + "relativePath":"artifacts/createKeyVaultWithSecret.json", + "contentVersion":"1.0.0.0" + }, + "parameters": { + "keyVaultName":{"value": "[parameters('keyVaultName')]"} + } + } + } + ], + "outputs": {} +} 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 ce7851dba95..bb5ffbb12f0 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 @@ -5,6 +5,7 @@ import json import os +import shutil import time import mock import unittest @@ -654,6 +655,246 @@ def test_provider_operation(self): ]) +class TemplateSpecsTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_template_specs_list', parameter_name='resource_group_one', location='westus') + @ResourceGroupPreparer(name_prefix='cli_test_template_specs_list', location='westus') + def test_list_template_spec(self, resource_group, resource_group_one, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-list-template-spec', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'tf': os.path.join(curr_dir, 'simple_deploy.json').replace('\\', '\\\\'), + 'rg': resource_group, + 'rg1': resource_group_one, + 'resource_group_location': resource_group_location, + }) + + template_spec_in_rg = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"').get_output_in_json() + template_spec_in_rg1_2 = self.cmd('ts create -g {rg1} -n {template_spec_name} -v 2.0 -l {resource_group_location} -f "{tf}"').get_output_in_json() + template_spec_in_rg1_3 = self.cmd('ts create -g {rg1} -n {template_spec_name} -v 3.0 -l {resource_group_location} -f "{tf}"').get_output_in_json() + + self.kwargs['template_spec_id_rg'] = template_spec_in_rg['id'].replace('/versions/1.0', '') + + self.kwargs['template_spec_version_id_rg1_2'] = template_spec_in_rg1_2['id'] + self.kwargs['template_spec_version_id_rg1_3'] = template_spec_in_rg1_3['id'] + self.kwargs['template_spec_id_rg1'] = template_spec_in_rg1_2['id'].replace('/versions/2.0', '') + + self.cmd('ts list -g {rg1}', checks=[ + self.check("length([?id=='{template_spec_id_rg}'])", 0), + self.check("length([?id=='{template_spec_id_rg1}'])", 1), + ]) + + self.cmd('ts list -g {rg}', checks=[ + self.check("length([?id=='{template_spec_id_rg}'])", 1), + self.check("length([?id=='{template_spec_id_rg1}'])", 0) + ]) + + self.cmd('ts list -g {rg1} -n {template_spec_name}', checks=[ + self.check('length([])', 2), + self.check("length([?id=='{template_spec_version_id_rg1_2}'])", 1), + self.check("length([?id=='{template_spec_version_id_rg1_3}'])", 1) + ]) + + self.cmd('ts list', checks=[ + self.check("length([?id=='{template_spec_id_rg}'])", 1), + self.check("length([?id=='{template_spec_id_rg1}'])", 1), + ]) + + # clean up + self.cmd('ts delete --template-spec {template_spec_id_rg} --yes') + self.cmd('ts delete --template-spec {template_spec_id_rg1} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_template_specs', location='westus') + def test_create_template_specs(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-create-template-spec', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'tf': os.path.join(curr_dir, 'template_spec_with_artifacts.json').replace('\\', '\\\\'), + 'resource_group_location': resource_group_location, + 'display_name': self.create_random_name('create-spec', 20), + 'description': '"AzCLI test root template spec"', + 'version_description': '"AzCLI test version of root template spec"', + }) + + path = os.path.join(curr_dir, 'artifacts') + if not os.path.exists(path): + files = ['createKeyVault.json', 'createKeyVaultWithSecret.json', 'createResourceGroup.json'] + os.makedirs(path) + for f in files: + shutil.copy(os.path.join(curr_dir, f), path) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" -d {display_name} --description {description} --version-description {version_description}', checks=[ + self.check('artifacts.length([])', 3), + self.check('artifacts[0].path', 'artifacts\\createResourceGroup.json'), + self.check('artifacts[1].path', 'artifacts\\createKeyVault.json'), + self.check('artifacts[2].path', 'artifacts\\createKeyVaultWithSecret.json') + ]).get_output_in_json() + + # clean up + self.kwargs['template_spec_id'] = result['id'].replace('/versions/1.0', ' ') + self.cmd('ts delete --template-spec {template_spec_id} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_template_specs', location='westus') + def test_update_template_specs(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-update-template-spec', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'tf': os.path.join(curr_dir, 'simple_deploy.json').replace('\\', '\\\\'), + 'tf1': os.path.join(curr_dir, 'template_spec_with_artifacts.json').replace('\\', '\\\\'), + 'resource_group_location': resource_group_location, + 'display_name': self.create_random_name('create-spec', 20), + 'description': '"AzCLI test root template spec"', + 'version_description': '"AzCLI test version of root template spec"', + }) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"', checks=[ + self.check('name', '1.0'), + self.check('description', None), + self.check('display_name', None), + self.check('artifacts.length([])', 0)]).get_output_in_json() + self.kwargs['template_spec_version_id'] = result['id'] + self.kwargs['template_spec_id'] = result['id'].replace('/versions/1.0', '') + + self.cmd('ts update -s {template_spec_id} --display-name {display_name} --description {description} --yes', checks=[ + self.check('name', self.kwargs['template_spec_name']), + self.check('description', self.kwargs['description'].replace('"', '')), + self.check('displayName', self.kwargs['display_name'].replace('"', '')) + ]) + + self.cmd('ts update -s {template_spec_version_id} --version-description {version_description} --yes', checks=[ + self.check('name', '1.0'), + self.check('description', self.kwargs['version_description'].replace('"', '')), + self.check('artifacts', None) + ]) + + path = os.path.join(curr_dir, 'artifacts') + if not os.path.exists(path): + files = ['createKeyVault.json', 'createKeyVaultWithSecret.json', 'createResourceGroup.json'] + os.makedirs(path) + for f in files: + shutil.copy(os.path.join(curr_dir, f), path) + + self.cmd('ts update -g {rg} -n {template_spec_name} -v 1.0 -f "{tf1}" --yes', checks=[ + self.check('description', self.kwargs['version_description'].replace('"', '')), + self.check('artifacts.length([])', 3), + self.check('artifacts[0].path', 'artifacts\\createResourceGroup.json'), + self.check('artifacts[1].path', 'artifacts\\createKeyVault.json'), + self.check('artifacts[2].path', 'artifacts\\createKeyVaultWithSecret.json') + ]) + + # clean up + self.cmd('ts delete --template-spec {template_spec_id} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_template_specs', location='westus') + def test_show_template_spec(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-get-template-spec', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'tf': os.path.join(curr_dir, 'simple_deploy.json').replace('\\', '\\\\'), + 'resource_group_location': resource_group_location, + }) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"', checks=[ + self.check('name', '1.0')]).get_output_in_json() + self.kwargs['template_spec_version_id'] = result['id'] + self.kwargs['template_spec_id'] = result['id'].replace('/versions/1.0', '') + + ts_cnt = self.cmd('ts show -g {rg} --name {template_spec_name}').get_output_in_json() + assert len(ts_cnt) > 0 + ts_cnt_by_id = self.cmd('ts show --template-spec {template_spec_id}').get_output_in_json() + assert len(ts_cnt_by_id) > 0 + assert len(ts_cnt) == len(ts_cnt_by_id) + + # clean up + self.cmd('ts delete --template-spec {template_spec_id} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_template_specs', location='westus') + def test_delete_template_spec(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-list-template-spec', 60) + self.kwargs.update({ + 'resource_group_location': resource_group_location, + 'template_spec_name': template_spec_name, + 'tf': os.path.join(curr_dir, 'simple_deploy.json').replace('\\', '\\\\'), + }) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"', + checks=self.check('name', '1.0')).get_output_in_json() + + self.kwargs['template_spec_version_id'] = result['id'] + self.kwargs['template_spec_id'] = result['id'].replace('/versions/1.0', ' ') + + self.cmd('ts show --template-spec {template_spec_version_id}') + self.cmd('ts show --template-spec {template_spec_id}') + + self.cmd('ts delete --template-spec {template_spec_version_id} --yes') + self.cmd('ts list -g {rg}', + checks=self.check("length([?id=='{template_spec_version_id}'])", 0)) + + self.cmd('ts delete --template-spec {template_spec_id} --yes') + self.cmd('ts list -g {rg}', + checks=self.check("length([?id=='{template_spec_id}'])", 0)) + + +class TemplateSpecsExportTest(LiveScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_template_specs', location='westus') + def test_export_template_spec(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + dir_name = self.create_random_name('TemplateSpecExport', 30) + dir_name2 = self.create_random_name('TemplateSpecExport', 30) + template_spec_name = self.create_random_name('cli-test-export-template-spec', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'tf': os.path.join(curr_dir, 'template_spec_with_artifacts.json').replace('\\', '\\\\'), + 'resource_group_location': resource_group_location, + 'output_folder': os.path.join(curr_dir, dir_name).replace('\\', '\\\\'), + 'output_folder2': os.path.join(curr_dir, dir_name2).replace('\\', '\\\\'), + }) + path = os.path.join(curr_dir, 'artifacts') + if not os.path.exists(path): + files = ['createKeyVault.json', 'createKeyVaultWithSecret.json', 'createResourceGroup.json'] + os.makedirs(path) + for f in files: + shutil.copy(os.path.join(curr_dir, f), path) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"', + checks=self.check('name', '1.0')).get_output_in_json() + + self.kwargs['template_spec_version_id'] = result['id'] + + os.makedirs(self.kwargs['output_folder']) + output_path = self.cmd('ts export -g {rg} --name {template_spec_name} --version 1.0 --output-folder {output_folder}').get_output_in_json() + + template_file = os.path.join(output_path, (self.kwargs['template_spec_name'] + '.json')) + artifactFile = os.path.join(output_path, 'artifacts\\createResourceGroup.json') + artifactFile1 = os.path.join(output_path, 'artifacts\\createKeyVault.json') + artifactFile2 = os.path.join(output_path, 'artifacts\\createKeyVaultWithSecret.json') + + self.assertTrue(os.path.isfile(template_file)) + self.assertTrue(os.path.isfile(artifactFile)) + self.assertTrue(os.path.isfile(artifactFile1)) + self.assertTrue(os.path.isfile(artifactFile2)) + + os.makedirs(self.kwargs['output_folder2']) + output_path2 = self.cmd('ts export --template-spec {template_spec_version_id} --output-folder {output_folder2}').get_output_in_json() + + _template_file = os.path.join(output_path2, (self.kwargs['template_spec_name'] + '.json')) + _artifactFile = os.path.join(output_path2, 'artifacts\\createResourceGroup.json') + _artifactFile1 = os.path.join(output_path2, 'artifacts\\createKeyVault.json') + _artifactFile2 = os.path.join(output_path2, 'artifacts\\createKeyVaultWithSecret.json') + + self.assertTrue(os.path.isfile(_template_file)) + self.assertTrue(os.path.isfile(_artifactFile)) + self.assertTrue(os.path.isfile(_artifactFile1)) + self.assertTrue(os.path.isfile(_artifactFile2))\ + + + class DeploymentTestAtSubscriptionScope(ScenarioTest): def tearDown(self): self.cmd('policy assignment delete -n location-lock') @@ -922,7 +1163,6 @@ def test_management_group_deployment(self): self.cmd('account management-group delete -n {mg}') -# TODO class DeploymentTestAtTenantScope(ScenarioTest): def test_tenant_level_deployment(self): @@ -1320,6 +1560,58 @@ def test_tenant_level_what_if(self): ]) +class DeploymentWhatIfTestWithTemplateSpecs(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_deployment_what_if_template_specs', location='westus') + def test_resource_group_level_what_if_ts(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-deploy-what-if-rg-deploy', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'resource_group_location': resource_group_location, + 'tf': os.path.join(curr_dir, 'storage_account_deploy.json').replace('\\', '\\\\'), + 'params': os.path.join(curr_dir, 'storage_account_deploy_parameters.json').replace('\\', '\\\\'), + }) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"').get_output_in_json() + self.kwargs['template_spec_version_id'] = result['id'] + + deployment_output = self.cmd('deployment group create --resource-group {rg} --template-spec "{template_spec_version_id}"').get_output_in_json() + self.kwargs['storage_account_id'] = deployment_output['properties']['outputs']['storageAccountId']['value'] + + self.cmd('deployment group what-if --resource-group {rg} --template-spec "{template_spec_version_id}" --parameters "{params}" --no-pretty-print', checks=[ + self.check('status', 'Succeeded'), + self.check("changes[?resourceId == '{storage_account_id}'].changeType | [0]", 'Modify'), + self.check("changes[?resourceId == '{storage_account_id}'] | [0].delta[?path == 'sku.name'] | [0].propertyChangeType", 'Modify'), + self.check("changes[?resourceId == '{storage_account_id}'] | [0].delta[?path == 'sku.name'] | [0].before", 'Standard_LRS'), + self.check("changes[?resourceId == '{storage_account_id}'] | [0].delta[?path == 'sku.name'] | [0].after", 'Standard_GRS') + ]) + + @ResourceGroupPreparer(name_prefix='cli_test_deployment_what_if_template_specs', location='westus') + def test_subscription_level_what_if_ts(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-deploy-what-if-sub-deploy', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'resource_group_location': resource_group_location, + 'tf': os.path.join(curr_dir, 'policy_definition_deploy.json').replace('\\', '\\\\'), + 'params': os.path.join(curr_dir, 'policy_definition_deploy_parameters.json').replace('\\', '\\\\'), + }) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"').get_output_in_json() + self.kwargs['template_spec_version_id'] = result['id'] + + deployment_output = self.cmd('deployment sub create --location westus --template-spec {template_spec_version_id}').get_output_in_json() + self.kwargs['policy_definition_id'] = deployment_output['properties']['outputs']['policyDefinitionId']['value'] + + self.cmd('deployment sub what-if --location westus --template-spec {template_spec_version_id} --parameters "{params}" --no-pretty-print', checks=[ + self.check('status', 'Succeeded'), + self.check("changes[?resourceId == '{policy_definition_id}'].changeType | [0]", 'Modify'), + self.check("changes[?resourceId == '{policy_definition_id}'] | [0].delta[?path == 'properties.policyRule.if.equals'] | [0].propertyChangeType", 'Modify'), + self.check("changes[?resourceId == '{policy_definition_id}'] | [0].delta[?path == 'properties.policyRule.if.equals'] | [0].before", 'northeurope'), + self.check("changes[?resourceId == '{policy_definition_id}'] | [0].delta[?path == 'properties.policyRule.if.equals'] | [0].after", 'westeurope'), + ]) + + class DeploymentScriptsTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_deployment_scripts') def test_list_all_deployment_scripts(self, resource_group): @@ -1407,6 +1699,117 @@ def test_delete_deployment_script(self, resource_group): checks=self.check("length([?name=='{deployment_script_name}'])", 0)) +class DeploymentTestAtSubscriptionScopeTemplateSpecs(ScenarioTest): + + @AllowLargeResponse(4096) + @ResourceGroupPreparer(name_prefix='cli_test_template_specs_tenant_deploy', location='eastus') + def test_subscription_level_deployment_ts(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-sub-lvl-ts-deploy', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'resource_group_location': resource_group_location, + 'tf': os.path.join(curr_dir, 'subscription_level_template.json').replace('\\', '\\\\'), + 'params': os.path.join(curr_dir, 'subscription_level_parameters.json').replace('\\', '\\\\'), + # params-uri below is the raw file url of the subscription_level_parameters.json above + 'params_uri': 'https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/subscription_level_parameters.json', + 'dn': self.create_random_name('azure-cli-subscription_level_deployment', 60), + 'dn2': self.create_random_name('azure-cli-subscription_level_deployment', 60), + }) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"', + checks=self.check('name', '1.0')).get_output_in_json() + + self.kwargs['template_spec_version_id'] = result['id'] + + self.cmd('deployment sub validate --location WestUS --template-spec {template_spec_version_id} --parameters "{params_uri}"', checks=[ + self.check('properties.provisioningState', 'Succeeded') + ]) + + self.cmd('deployment sub create -n {dn} --location WestUS --template-spec {template_spec_version_id} --parameters @"{params}"', checks=[ + self.check('properties.provisioningState', 'Succeeded') + ]) + + self.cmd('deployment sub show -n {dn}', checks=[ + self.check('name', '{dn}') + ]) + + self.cmd('deployment sub export -n {dn}', checks=[ + ]) + + self.cmd('deployment operation sub list -n {dn}', checks=[ + self.check('length([])', 5) + ]) + + self.cmd('deployment sub create -n {dn2} --location WestUS --template-spec "{template_spec_version_id}" --parameters @"{params}" --no-wait') + + self.cmd('deployment sub cancel -n {dn2}') + + self.cmd('deployment sub show -n {dn2}', checks=[ + self.check('properties.provisioningState', 'Canceled') + ]) + + # clean up + self.kwargs['template_spec_id'] = result['id'].replace('/versions/1.0', ' ') + self.cmd('ts delete --template-spec {template_spec_id} --yes') + + +class DeploymentTestAtResourceGroupTemplateSpecs(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_template_specs_resource_group_deployment', location='westus') + def test_resource_group_deployment_ts(self, resource_group, resource_group_location): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + template_spec_name = self.create_random_name('cli-test-resource-group-ts-deploy', 60) + self.kwargs.update({ + 'template_spec_name': template_spec_name, + 'resource_group_location': resource_group_location, + 'tf': os.path.join(curr_dir, 'simple_deploy.json').replace('\\', '\\\\'), + 'params': os.path.join(curr_dir, 'simple_deploy_parameters.json').replace('\\', '\\\\'), + 'dn': self.create_random_name('azure-cli-resource-group-deployment', 60), + 'dn2': self.create_random_name('azure-cli-resource-group-deployment', 60), + }) + + result = self.cmd('ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"', + checks=self.check('name', '1.0')).get_output_in_json() + + self.kwargs['template_spec_version_id'] = result['id'] + + self.cmd('deployment group validate --resource-group {rg} --template-spec "{template_spec_version_id}" --parameters @"{params}"', checks=[ + self.check('properties.provisioningState', 'Succeeded') + ]) + + self.cmd('deployment group create --resource-group {rg} -n {dn} --template-spec "{template_spec_version_id}" --parameters @"{params}"', checks=[ + self.check('properties.provisioningState', 'Succeeded'), + ]) + + self.cmd('deployment group list --resource-group {rg}', checks=[ + self.check('[0].name', '{dn}'), + ]) + + self.cmd('deployment group list --resource-group {rg} --filter "provisioningState eq \'Succeeded\'"', checks=[ + self.check('[0].name', '{dn}'), + ]) + + self.cmd('deployment group show --resource-group {rg} -n {dn}', checks=[ + self.check('name', '{dn}') + ]) + + self.cmd('deployment group export --resource-group {rg} -n {dn}', checks=[ + ]) + + self.cmd('deployment operation group list --resource-group {rg} -n {dn}', checks=[ + self.check('length([])', 2) + ]) + + self.cmd('deployment group create --resource-group {rg} -n {dn2} --template-spec "{template_spec_version_id}" --parameters @"{params}" --no-wait') + + self.cmd('deployment group cancel -n {dn2} -g {rg}') + + self.cmd('deployment group show -n {dn2} -g {rg}', checks=[ + self.check('properties.provisioningState', 'Canceled') + ]) + + class ResourceMoveScenarioTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_resource_move_dest', parameter_name='resource_group_dest', key='rg2') @ResourceGroupPreparer(name_prefix='cli_test_resource_move_source', key='rg1')