Skip to main content

Cloud

Azure ARM Template: Import and Export Templates from Portal

The feature support for Azure Resource Manager and ARM Templates has been a little light since it’s initial release. This is something that is slowly changing, however, an update to the Azure Portal released this week helps move ARM Template support forward in a big way. This new feature is the ability to Export any Azure Resource Group as an ARM Template. This compliments the Import functionality of the Azure Portal to take everything full circle. You can now setup an Azure Resource Group full of resources, export an ARM Template for it, then take that template and deploy to a different Resource Group. This article will show exactly where to find these features within the Azure Portal.

Export Resource Group to ARM Template

The newest feature in the circle of Import/Export of ARM Templates is the Export feature within the Azure Portal. This allows for a Resource Group and all it’s resources to be setup and configured first within the Azure Portal or otherwise first, then it can all be easily exported out to an ARM Template.
To Export an Azure Resource Group, first navigate to the Resource Group within the Azure Portal, then click on “Export Template” under the Resource Group Settings.
AzurePortal_ExportARM_ExportTemplate
Once navigating to “Export Template” a new pane will be displayed that will show the ARM Template for the selected Resource Group. From this pane, the ARM Template can be Downloaded, Saved, or Deployed.
AzurePortal_ExportARM_ViewTemplate
When Downloaded, the ARM Template will be saved to the local machine. This will allow for the template to be manually changed or saved somewhere for it to be retrieved for later use.
When Saving, the ARM Template will be saved to a collection accessible from “Browse > Templates” within the Azure Portal. This allows for Resource Group configurations to be saved so they can easily be redeployed later.
When Deploying, the ARM Template will be deployed to a new Resource Group. This essentially allows for the Resource Group to be “copied.” This could be useful for easily cloning a Resource Group to easily spin up a separate hosting environment with identical settings.

Import ARM Template to Resource Group

Once you have an ARM Template it can be easily deployed to a new Resource Group directly from within the Azure Portal. This could be a Template previously exported from the Azure Portal, or a new Template that may have been created offline or shared from someone else.
To bring up the interface for deploying an ARM Template within the Azure Portal, just select “New” in the menu on the left side of the Portal, then search for “Template Deployment” within the Marketplace. Once found, select and create a new “Template Deployment.”
AzurePortal_ImportARM_Marketplace
The “Template Deployment” option within the Marketplace will bring up an interface in the Azure Portal to setup and deploy a “Custom deployment” from an ARM Template. This interface will allow for the Template to be defined, as well as any Parameters, Resource Group and Location necessary for deploying the resources.
AzurePortal_ImportARM_CustomDeployment
The “Custom Deployment” interface also includes the ability to select an ARM Template from the Azure Quickstart Templates directly from within the Azure Portal.

Azure Quickstart Templates

The Azure Quickstart Templates are a huge list of ARM Templates for various Azure resource deployment scenarios. There are hundreds of templates in the list, and they are all contributed by the community through a GitHub project managed by Microsoft.
AzureQuickstartTemplatesSiteScreenshot
When viewing a specific Template in the Quickstart website, it will display the details for that Template. This will include a description of what the Template is, the list of deployment Parameters for the Template, along with a “Deploy to Azure” button that deep links into the “Custom Deployment” section of the Azure Portal to go deploy that ARM Template within your Azure Subscription.
AzureQuickstartTemplatesSiteScreenshot_SingleTemplate
Additionally, the Quickstart details page for a Template will show the 2 lines of Azure PowerShell or X-plat CLI necessary to deploy the ARM Template directly from the console.

Thoughts on “Azure ARM Template: Import and Export Templates from Portal”

  1. What would happen if you transported an Azure Resource Group ARMTemplate into a completely new, stand-alone, air-gapped instance of Azure that had 0 connectivity to the original instance of Azure? Would it still be able to recreate the resources? What about certificates? How are those handled?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Chris Pietschmann

Chris is an Azure Solutions Architect with more than 14 years of experience building Enterprise systems using a wide array of Microsoft technologies, including Bing Maps and the Microsoft Azure cloud. He has been a 5 time recipient of the Microsoft MVP award. Chris has successfully implemented numerous Enterprise solutions on the Microsoft Azure Cloud Platform since its initial release all the way back in 2010.

More from this Author

Categories
Follow Us