Azure / template-specs

MIT License
31 stars 4 forks source link

Deploy specific version of the template using portal or other mediums #35

Closed itshemant09 closed 3 years ago

itshemant09 commented 4 years ago

May be I am missing something but Suppose If I have a multiple versions of my template and I want to deploy specific version. How I can deploy it?

image

I do not find any option to deploy specific version. How to to it via PowerShell or CLI?

alex-frankel commented 4 years ago

Today in the portal when you click "Deploy" on the main template spec blade, it's going to automatically choose the latest version (according to creation date). We will support choosing a version to deploy from the page you took a screenshot of, but we don't support it yet. Portal support is very limited right now. We recommend you use PowerShell or CLI.

Here is the relevant doc for powershell: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/quickstart-create-template-specs?tabs=azure-powershell

CLI docs should be available this week, but you can install that from this repo as well. Here is a helpful snippet in the meantime:

Create template-spec:

az template-specs create -f ./mainTemplate.json -l eastus -g brittle-hollow -v 0.1 -n basic

Deploy template-spec (bash):

TSID=$(az template-specs show -n basic -g brittle-hollow -v 0.1 --query id)
az deployment group create -s $TSID -g brittle-hollow --verbose
stuartko commented 3 years ago

As of late August you can now deploy a specific version via the portal by right clicking on any version within a template spec, or by choosing deploy from the version page itself.

image