10

Azure Template Specs: Reusable ARM Templates

Infrastructure as Code (IaC) is undoubtedly the gold standard when it comes to modern cloud infrastructure. Tools like Bicep, Terraform,…

Infrastructure as Code (IaC) is undoubtedly the gold standard when it comes to modern cloud infrastructure. Tools like Bicep, Terraform, and Pulumi allow for clean, repeatable, and automated deployments.

But what if you’re working in an environment where manual deployments are still common—and yet, you still want standardization, reusability, and version control?

This is where Azure Template Specs shine.

What Are Azure Template Specs?

Template Specs allow you to store and version ARM templates directly in Azure, just like you’d store code in a repository. Once uploaded, they can be used in deployments across the portal, Azure CLI, or PowerShell—without needing to re-upload or manage the raw JSON files.

🔑 Key Benefits:

  • Centralized template storage with versioning
  • Reusability across teams and subscriptions
  • No need for GitOps or CI/CD to start using standardized templates
  • Works with Azure Portal, CLI, and PowerShell

🧠 Why This Matters

Having a central repository of reusable templates (with versioning!) helps you:

  • Maintain consistency in manual or semi-automated deployments
  • Give non-dev users access to well-tested templates
  • Avoid accidental misconfigurations and hard-to-debug drift

Even without a full DevOps pipeline, this method brings structure and governance to your infrastructure setup.

🔒 Required permissions

There are two Azure built-in roles defined for template spec:

Example: Creating a Template Spec – AVD RemoteApp

A great example is the deployment of an Azure Virtual Desktop (AVD) RemoteApp. The template creates a new Application Group, links it to an existing host pool and workspace, and defines key app settings like file path and icon.

💡 I got this ARM Template – aswell as the template of the automated VM Ordering Project – located in my GitHub (Link: https://github.com/simon-vedder/arm/template/templatespecs-examples)

But there are endless possibilities!

Step 1: Open Template Specs Resource

  1. In the Azure Portal, search for “Template Specs” in the top search bar.
  2. Click on the result and open the Template Specs blade.

Step 2: Create a New Template Spec

  1. Click on “+ Create”. (or import an existing one)
  2. Fill in the required fields:
    • Subscription – select your subscription
    • Resource Group – e.g., Templates
    • Name – e.g., AzCompanyRemoteApp
    • Location – e.g., West Europe
    • Description – optional but helpful
  3. Add Version information
    • Version Number – e.g., v1.0, 1.0
    • Change Notes – optional but especially helpful in further versions

Click Next: Edit template to proceed.

Step 3: Edit template

Here you simply add your ARM Template Code.

Step 4: Add Tags and save your Template Spec

You can and should use tags in your environment and then click Review+Create to create the Template Spec.

After creating you should find your template specs within the overview.

Deploying your Resources via Template Spec

To deploy your resources via your created template spec there are multiple ways: manual or programmatical (CLI and PowerShell).

🤖 PowerShell and CLI deployments can also be implemented in a CI/CD workflow

Option 1: Manual

  1. Open the template spec
  2. Click on Deploy
  3. Fillout the Parameters of the ARM Template
  4. Create the resources

❗️Information: Here I am using an other template which I wanted to test but the workflow is the same.

Option 2: Programmatical

Here you have multiple options and I would recommend to automate this task or – even better – implement it in CI/CD.

For each possibility copy the template spec‘s resource ID at first. You will find it in the properties section of the template spec.

via PowerShell

New-AzSubscriptionDeployment `
  -Location "westeurope" `
  -TemplateSpecId "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.Resources/templateSpecs/<spec-name>/versions/<version>" `
  -adminUsername "simon" `
  -adminPassword "Secret123"

via CLI

az deployment sub create \
  --location westeurope \
  --template-spec "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.Resources/templateSpecs/<spec-name>/versions/<version>" \
  --parameters adminUsername=simon adminPassword=Geheim123

🎯 Pro Tip: If you want to update the Template Spec in the future, just create a new version. Azure keeps each version independently, so you can reference older versions in deployments if needed.

🧠 Final Thoughts: A Practical Middle Ground

Azure Template Specs are not a replacement for Infrastructure as Code—but they’re a powerful middle ground for teams who:

  • Prefer working in the Portal but want consistency
  • Need to reuse complex ARM templates without managing CI/CD
  • Are slowly transitioning to full automation

They let you bridge the gap between ad-hoc deployments and robust automation—especially in growing teams or hybrid environments.

👉 Want a follow-up post on how to create and publish Template Specs (via Bicep or CLI)? Or how to structure versioning and permissions? Let me know—I’d be happy to share more!

Do you use Template Specs in your environment? Or are you fully committed to IaC tooling like Bicep and Terraform?

Feel free to share your thoughts in the comments!

Simon

Cloud Engineer focused on Azure, Terraform & PowerShell. Passionate about automation, efficient solutions, and sharing real-world cloud projects and insights. ⸻ Let me know if you’d like to make it more casual, technical, or personalized.

Leave a Reply

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