Step-By-Step: Export a Resource Group as an ARM Template.
We’ve been talking about ARM templates for a while now:
- DevOps Basics: Infrastructure as Code – ARM Templates
- DevOps Basics: ARM Templates Part 2
- DevOps Basics: Infrastructure as Code – The PowerShell Method
Yet, i still get questions about the difference between the ARM model and the classic Cloud Service model. If you are still confused, watch the following video from Corey Sanders, Director of Program Management on the Microsoft Azure Compute team answering common questions regarding when to use "Classic" Azure services vs "Resource Manager" ARM templates.
ARM templates are not trivial to build, yes, we have plenty of samples available for you to download and modify. However, we can now export an existing environment to a ARM Template through the portal, or retrieve the template that was used for a particular deployment. This week we will cover how to export an existing environment.
This provides 2 big benefits:
- You can easily automate future deployments of the solution because all of the infrastructure is defined in the template.
- You can become familiar with template syntax by looking at the JSON file that represents your solution.
Export your existing environment
From the resource group blade, in the portal, you can export the template that represents the current state of the resource group.
- The template that defines the infrastructure for your solution
- A parameter file that you can use to pass in values during deployment
- An Azure CLI script file that you can execute to deploy the template
- An Azure PowerShell script file that you can execute to deploy the template
- A .NET files that you can execute to deploy the template
I hope this answered some questions. please let us know in the comments what you would like us to cover.