az ts

Manage template specs at subscription or resource group scope.

Commands

az ts create

Create a template spec and or template spec version.

az ts delete

Delete a specified template spec or template spec version by name or resource ID..

az ts export

Export the specified template spec and artifacts (if any) to the specified output folder.

az ts list

List template specs or template spec versions.

az ts show

Get the specified template spec or template spec version.

az ts update

Update a template spec version.

az ts create

Create a template spec and or template spec version.

az ts create --name
             --resource-group
             [--description]
             [--display-name]
             [--location]
             [--subscription]
             [--tags]
             [--template-file]
             [--version]
             [--version-description]
             [--yes]

Examples

Create a template spec.

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

Create a template spec version.

az ts create -g testRG --name TemplateSpecName -v 2.0 -l WestUS --template-file templateSpec.json --version-description "Less simple template spec" --tags key1=value1 key3=value3

Create a template spec and a version of the template spec.

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" --tags key1=value1 key2=value2

Required Parameters

--name -n

The name of the template spec.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--description

The description of the parent template spec.

--display-name -d

The display name of the template spec.

--location -l

The location to store the template-spec and template-spec version(s). Cannot be changed after creation.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--template-file -f

A template file path in the file system.

--version -v

The template spec version.

--version-description

The description of the template spec version.

--yes -y

Do not prompt for confirmation.

az ts delete

Delete a specified template spec or template spec version by name or resource ID..

az ts delete [--name]
             [--resource-group]
             [--subscription]
             [--template-spec]
             [--version]
             [--yes]

Examples

Delete the specified template spec and all versions.

az ts delete -g MyResourceGroup --name TemplateSpecName

Delete the specified version from the template spec.

az ts delete -g MyResourceGroup --name TemplateSpecName --version VersionName

Delete the template spec or version based on resource ID.

az ts delete --template-spec resourceID

Optional Parameters

--name -n

The name of the template spec.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--template-spec -s

The template spec resource id.

--version -v

The template spec version.

--yes -y

Do not prompt for confirmation.

az ts export

Export the specified template spec and artifacts (if any) to the specified output folder.

az ts export --output-folder
             [--name]
             [--resource-group]
             [--subscription]
             [--template-spec]
             [--version]

Examples

Export the specified template spec with all versions.

az ts export -g testrg --name TemplateSpecName --output-folder C:/path/

Export the specified template spec.

az ts export -s resourceID --output-folder C:/path/

Export the specified template spec version.

az ts export -g testrg --name TemplateSpecName --version VersionName --output-folder C:/path/

Required Parameters

--output-folder

Existing folder to output export(s).

Optional Parameters

--name -n

The name of the template spec.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--template-spec -s

The template spec resource id.

--version -v

The template spec version.

az ts list

List template specs or template spec versions.

az ts list [--name]
           [--query-examples]
           [--resource-group]
           [--subscription]

Examples

List all template specs in current default subscription.

az ts list

List all template specs in specified subscription.

az ts list --subscription Subscription

List all template specs in resource group.

az ts list -g MyResourceGroup

List all versions of parent template spec.

az ts list -g MyResourceGroup -n TemplateSpecName

Optional Parameters

--name -n

The name of the template spec.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az ts show

Get the specified template spec or template spec version.

az ts show [--name]
           [--query-examples]
           [--resource-group]
           [--subscription]
           [--template-spec]
           [--version]

Examples

Show the specified template spec.

az ts show -g testrg --name TemplateSpecName

Show the specified template spec version.

az ts show -g testrg --name TemplateSpecName --version VersionName

Show the specified template spec or template spec version based on the resource ID.

az ts show --template-spec resourceID

Optional Parameters

--name -n

The name of the template spec.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--template-spec -s

The template spec resource id.

--version -v

The template spec version.

az ts update

Update a template spec version.

az ts update [--description]
             [--display-name]
             [--name]
             [--resource-group]
             [--subscription]
             [--tags]
             [--template-file]
             [--template-spec]
             [--version]
             [--version-description]
             [--yes]

Examples

Update the template content of a template spec or template spec version based on the resource ID.

az ts update --template-spec resourceID -f updatedFile.json

Update the display name and tag(s) of a template spec based on the resource ID.

az ts update --template-spec resourceID --display-name "NewParentDisplayName" --tags key1=value1

Update the description of a template spec version with no prompt.

az ts update -g ExistingRG --name ExistingName -v 3.0 --version-description "New description" --yes

Update all the properties of a template spec version.

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"

Remove tag(s) from template spec version with no prompt.

az ts update -g ExistingRG --name ExistingName -v 3.0 -f updatedTemplate.json --tags --yes

Optional Parameters

--description

The description of the parent template spec.

--display-name -d

The display name of the template spec.

--name -n

The name of the template spec.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--template-file -f

A template file path in the file system.

--template-spec -s

The template spec resource id.

--version -v

The template spec version.

--version-description

The description of the template spec version.

--yes -y

Do not prompt for confirmation.