What are ARM Templates? Azure Infrastructure as Code Guide
Azure Resource Manager (ARM) templates are JSON files that allow you to define your Azure infrastructure declaratively. Instead of manually creating resources, you describe the desired final state, and Azure handles the deployment. This ensures consistency, repeatability, and idempotency across development, testing, and production environments.
What exactly are Azure Resource Manager templates?
Think of an ARM template as a blueprint for your cloud environment. In the old days, if you wanted to deploy a virtual machine, a virtual network, and a storage account, you had to execute a series of manual steps or run a script that told Azure exactly how to do it step-by-step. That's called 'imperative' deployment. ARM templates flip the script by using 'declarative' syntax.
Using JSON (JavaScript Object Notation), you simply describe what you want the end result to look like. You tell Azure, 'I want a Standard_D2s_v3 VM in East US,' and the Azure Resource Manager handles the heavy lifting of figuring out the order of operations and the API calls required to make it happen. This removes the guesswork and the risk of human error that comes with clicking through the Azure Portal.
Why is idempotency a game-changer for your deployments?
Idempotency is a fancy word that you'll definitely encounter while studying for the AZ-900. In plain English, it means that no matter how many times you deploy the same ARM template, the result will always be the same. If the resources already exist and haven't changed, Azure does nothing. If a resource has drifted from the configuration, Azure corrects it to match the template.
This is critical for maintaining environment parity. Imagine you have a Development, Testing, and Production environment. By using idempotent ARM templates, you can be 100% certain that your Production environment is a mirror image of the Testing environment where you just validated your app. It eliminates the 'it worked on my machine' syndrome by ensuring the infrastructure is identical every single time.
How do you separate parameters from template logic?
A common mistake beginners make is hardcoding values—like VM names or IP addresses—directly into the main JSON template. This makes the template rigid and useless for multiple environments. To solve this, we use a separate parameters file. The main template contains the logic (the 'what'), while the parameters file contains the specific values (the 'which').
For example, your main template might have a parameter called 'environmentName'. In your dev-parameters.json file, that value is 'Dev-Web-Server', but in your prod-parameters.json file, it's 'Prod-Web-Server'. This separation allows you to reuse the exact same infrastructure logic across your entire organization while tailoring the specifics to each project or stage of the lifecycle.
How do ARM templates fit into a CI/CD pipeline?
In a professional enterprise setting, you aren't uploading JSON files manually. Instead, ARM templates are treated as code—hence the term 'Infrastructure as Code' (IaC). You store your templates in a version control system like Git. When a developer pushes a change to the template, it triggers a Continuous Integration/Continuous Deployment (CI/CD) pipeline using tools like Azure DevOps or GitHub Actions.
This pipeline automatically validates the template syntax, runs a 'what-if' analysis to see what changes will occur, and then deploys the updates to the environment. This creates a complete audit trail of every change made to your infrastructure. If a deployment causes a crash, you don't have to scramble to remember what you clicked in the portal; you simply roll back to the previous version of the template in Git.
How does this appear on the AZ-900 exam?
For the Azure Fundamentals exam, you don't need to be able to write a complex JSON file from scratch, but you must understand the core concepts: declarative syntax, idempotency, and the role of ARM in the broader Azure ecosystem. You'll likely see questions asking you to distinguish between ARM templates and manual portal configuration or identifying the benefits of IaC.
To really nail these concepts, you need a high volume of quality practice. We provide 1,000 expert-curated Microsoft Azure Fundamentals (AZ-900) practice questions at Cert Sensei. Our platform doesn't just tell you if you're wrong; it provides detailed expert reasoning for every answer and domain-level analytics so you know exactly where you're struggling—whether it's cloud concepts or Azure architecture.
What is the difference between ARM templates and Bicep?
If you start looking into Azure IaC, you'll quickly run into 'Bicep.' Bicep is a Domain Specific Language (DSL) created by Microsoft to make ARM templates easier to write. While ARM templates use JSON—which can become a nightmare of curly braces and brackets as they grow—Bicep uses a much cleaner, more concise syntax that looks more like traditional programming code.
Here is the secret: Bicep is actually just a transparent abstraction over ARM. When you deploy a Bicep file, Azure 'transpiles' it into a standard ARM JSON template before executing it. For the AZ-900, just remember that Bicep is the modern, human-friendly way to create the same declarative deployments that ARM templates provide.
❓ Frequently Asked Questions
Do I need to be a JSON expert to pass the AZ-900?
Not at all. You need to understand that ARM templates use JSON and that they are declarative. You won't be asked to write complex JSON code during the exam, but you should recognize the structure and know why it's used for automation.
Can I turn an existing Azure resource into an ARM template?
Yes. In the Azure Portal, you can navigate to any resource group and select 'Export template.' This generates a JSON file based on your current deployment, which is a great way to learn how ARM templates are structured.
Is ARM the only way to do Infrastructure as Code in Azure?
No. While ARM and Bicep are native to Azure, many organizations use Terraform by HashiCorp. Terraform is cloud-agnostic, meaning it can manage resources across Azure, AWS, and GCP using a single tool.