Last Update: Sep 04, 2024 | Published: Aug 01, 2016
In today’s Ask the Admin, I’ll show you how to export resource groups (RGs) as Azure Resource Manager (ARM) templates.
One of the great features of ARM is the ability to define how Azure resources interconnect with one another using resource groups, and deploy cloud applications, in the web-based management portal or using PowerShell, and then copy and redeploy that configuration using a declarative JSON template. If you need a primer on ARM and Azure resource groups, see Deploy VMs Using Azure Resource Manager, What is JSON and How Is It Used?, and What are Microsoft Azure resource groups? on the Petri IT Knowledgebase.
In this article, I want to show you how easy it is to copy ARM-based deployments in Azure, and either save the configuration for later use as a JSON template, or deploy a new resource group based on the configuration of an existing set of resources. For example, I have a resource group called PetriWeb that contains several VMs, public IP addresses, a virtual network, storage, and other resources that make the application work. But I need to reproduce this configuration so that I can test some proposed changes in a lab environment. Azure allows the PetriWeb resource group to be exported and redeployed with a different name using the JSON template generated during the export process.
Before starting, you’ll need an Azure account. If you don’t already have one, you can sign up for a free trial here.
Azure will now generate a JSON template based on the selected resource group.
You also have the option to deploy the resources defined in the template without leaving the portal GUI.
It’s worth noting here that you may need to change some of the prepopulated values in the step above if the names given are in use elsewhere in your Azure subscription, otherwise preflight validation of the template might fail.
Once the deployment has completed, the new resource group will be accessible from the Azure portal dashboard, or by browsing your resource groups.
In this article, I showed you how to export Azure resource group configurations to ARM templates.