Skip to content

Conversation

@detienne20
Copy link
Contributor

Description

Template Specs create and update now supports --tags.

Testing Guide

                           **The test cases added cover all of the following**

(1)
az ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" --tag cli-test=test

 Expected Result(s):

      If the parent template spec does not yet exist, the tag(s) will apply to both the parent (template spec) and the child 
      (template spec version). 

       If the parent template spec exists, only the child (template spec version) will be assigned the tag. Note: A child ( 
       template spec version) can have different tags from it's parent (template spec). Changing the tags of the child does not 
       affect the parent. 

(2)

az ts create -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}"

   Expected Result(s): 
        
      If the parent (template spec) does not yet exist, no tags will be applied to the parent or the child (tags={}) 
      
      If the parent (template spec) exists then the new child will inherit the parents' tags or lack of tags. 

      If the child (template spec version) already exists this command will function the same. Create will override the child 
      (template spec version). 

(3a.)

az ts update -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" --tags --yes

az ts update -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" --tags "" --yes

az ts update -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" --tags '' --yes

 Expected Result(s):
      All the commands listed above in #3 should result in tags being removed (tags = {}). When updating a template 
      spec or template spec version tags should only be removed if explicitly empty. 

(3b.)

az ts update -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" --yes

az ts update -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" --yes

az ts update -g {rg} -n {template_spec_name} -v 1.0 -l {resource_group_location} -f "{tf}" --yes

 Expected Result(s):
      Tags should be unchanged. 

This checklist is used to make sure that common guidelines for a pull request are followed.

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 4, 2020

ARM

@yonzhan yonzhan added this to the S180 milestone Dec 4, 2020
@yonzhan yonzhan requested a review from jsntcy December 4, 2020 12:58
examples:
- name: Create a template spec.
text: az ts create -g testRG --name TemplateSpecName -l WestUS --display-name "MyDisplayName" --description "Simple template spec"
text: az ts create -g testRG --name TemplateSpecName -l WestUS --display-name "MyDisplayName" --description "Simple template spec" --tag key1=value1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text: az ts create -g testRG --name TemplateSpecName -l WestUS --display-name "MyDisplayName" --description "Simple template spec" --tag key1=value1
text: az ts create -g testRG --name TemplateSpecName -l WestUS --display-name "MyDisplayName" --description "Simple template spec" --tags key1=value1

- 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 the display name and tag(s) of a template spec based on the resource ID.
text: az ts update --template-spec resourceID --display-name "NewParentDisplayName" --tag key1=value1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text: az ts update --template-spec resourceID --display-name "NewParentDisplayName" --tag key1=value1
text: az ts update --template-spec resourceID --display-name "NewParentDisplayName" --tags key1=value1

@Juliehzl
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Juliehzl Juliehzl merged commit 2537c2a into Azure:dev Dec 16, 2020
@detienne20 detienne20 deleted the daetienn/TS_TagsSupport branch January 7, 2021 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants