Closed stweb1963 closed 3 years ago
New-AzTemplateSpec has separate parameters for the root template spec description and the version description. To set the version description you can use the parameter -VersionDescription "your version description here"
If I have misunderstood the issue you're having here, please let me know, otherwise I will close this issue.
Yes, looks like this was my issue, thanks Testing now, and will confirm
A little misleading as I assumed if using -Version parameter then -Description would apply to the version
When a version is being created, a "root" template spec resource (essentially a container) is updated/created too, so we need to provide the capability of providing a description for both the root and the version independently, which unfortunately can cause some confusion.
If you have suggestions on how this may be improved, we're very open to improvements/changes.
For now I'll close this issue.
So testing proved successful but this is how I need to handle it base on how tagging get applied
To separate templateSpec 'root' tags from 'version' tags you need to use Set-AzTemplateSpec first (no version) Then push the version with the tags specific to the version => New-AzTemplateSpec -Version
If you push the version without first creating the root, the specific version tags are attached to the root so I need to so something like this
#first (only once if the spec does not exist)
Set-AzTemplateSpec -Name name -ResourceGroupName rgName -Location canadacentral `
-Description 'description' -Tag @{'rootTag'='a tag value'}
#then we do this ongoinging
New-AzTemplateSpec -Name name -ResourceGroupName rgName -Location canadacentral `
-Version '1.0.0' -VersionDescription 'description' `
-Tag @{'versionTag'='a tag value'} -TemplateFile ./main.json
I think the only alternative is to not tag the root template spec when you are creating parent + version. Would that work better for you? We could also introduce a flag to control the behavior like -OnlyTagVersion
or something like that
The description is not retained when using PowerShell to create a templateSpec version There is no issue if performed using the portal
Sample Command
Reference