How can we deploy Azure Template Specs.

After the publishing of the Azure ARM Template Spec you need to be able to deploy these templates. One of the site notes for now is that this future is still in preview. For this reason the link to the original site is : TemplateSpec

This blog is part of a series of blog about “Building an ARM Repository.”

Deploy ARM files from Azure

  1. Select the template spec you created.
  1. Select Deploy
  1. Provide the following values:
    • Subscription: select an Azure subscription for creating the resource.
    • Resource group: select Create new and then enter storageRG.
    • Storage Account Type: select Standard_GRS.
  2. Select Review + create.
  3. Select Create.

Deploy template spec with PowerShell

To deploy a template spec, use the same deployment commands as you would use to deploy a template. Pass in the resource ID of the template spec to deploy.

  1. Create a resource group to contain the new storage account.
    New-AzResourceGroup ` -Name storageRG ` -Location westus2
  2. Get the resource ID of the template spec.
    $id = (Get-AzTemplateSpec -ResourceGroupName templateSpecRG -Name storageSpec -Version "1.0").Versions.Id
  3. Deploy the template spec.
    New-AzResourceGroupDeployment ` -TemplateSpecId $id ` -ResourceGroupName storageRG
  4. You provide parameters exactly as you would for an ARM template. Redeploy the template spec with a parameter for the storage account type.
    New-AzResourceGroupDeployment ` -TemplateSpecId $id ` -ResourceGroupName storageRG ` -storageAccountType Standard_GRS

Leave a Reply

Your email address will not be published. Required fields are marked *