Export Azure resource group template

A useful functionality in Azure that has entered preview a few weeks ago is the ability to export a resource group as a template.
This is very handy when you want to automate your environment setup or perhaps securely store your infrastructure setup in your source-control-of-choice.

 Here's how it works when you're doing it from the portal:

1

  1. Navigate to a resource group
  2. Select "Settings"
  3. In the Settings blade, hit "Export template"

 As the Export Template blade unfolds you'll be presented with the following view that show you the actions available as well as the actual template itself.

2

The Export template blade will not only show you the layout and contents of your arm template, but also the available parameters that affect your template:

4

Adding to that there's three more tabs that help you deploy the template..

5

.. CLI

6

.. Powershell

7

.. .NET / C#

Since this functionality is currently in preview you might end up trying to export a resource that's not supported at this point. If that happens, you'll see something like this in the blade:

8

To work around that you can always add the missing resource(s) manually after you've exported the template.

To act on your template you have 3 options:

3

 Download
Creates a zip file with the template along with all the sample deployment files as well.
 Save Template
Gives you the opportunity to save the template in Azure so that you can use it later via Browse > Templates.
 Deploy
Creates a custom deployment based on the template.