Convert Azure Resource Groups to a template

Hi there! It’s the Azureman, aka Bert Wolters, with another post on new functionality in Azure which is crazy cool….

For some time now, we have the ability to create resources in the Microsoft public cloud by using templates. If you’re interested in how to get started with templates, you might want to visit the Azure Quickstart templates section on GitHub. These templates ensure that everytime we deploy resources, using the template, this deployment will result in the exact same configuration. Very helpful in setting up base environments for your customers.

For some time now, the community of Azure users requested Microsoft to create a solution to export a running configuration on the Azure platform into a template, so we can re-use the complete solution in a development or acceptation environment. Is Microsoft answering to the bidding of the community? Yes they are! And in a phenomenal way! Just head over to the Azure User Voice portal and submit your great ideas, with proper explanation and see the community in action…

Last week we received confirmation that the work on the idea “Ability to export a Resource Group as a template” was completed and that it was implemented in the New Azure Portal.

2016-04-04_15-10-48

Very eager to try this out, I headed to the new Azure portal, and logged in with my MSDN account, which is part of the MCT (Microsoft Certified Trainer) benefits program. I wanted to start small, so I grabbed a resource group which only contains a single standard storage account. Just head over to your resource groups, select a resource group, select settings (so don’t browse to your Storage Account) and then choose “Export Template”

single storage account

There you go, one fully exportable template to use in any tool you like to edit and/or redeploy the exact same configuration over and over….  But how about some slightly more complex resource groups? Let’s start off with a Virtual Machine.

In my environment (and for so many others out there) the resource group of a virtual machine is built from a lot of small building blocks, providing “the service”  of a virtual machine. In the resource group “HybridVm01” I have the following resources:

  • The Virtual Machine object itself (compute)
  • A virtual Network interface to the virtual network
  • A Virtual Public IP, directly bound to the VM’s vNIC
  • A storage account where the VHD’s of the virtual machine reside.

Upon exporting the template it was another success for the platform!

single vm

Now, for the grand final for today… The network connectivity to my on-premises environment. Indeed a complete site-to-site VPN connection…. I went back to Resource Groups, selected the Resource Group which contains my gateways, Network Security Groups, Public IP and Subnets….. and when choosing for “Export Template” for a third time…

hybrid vnet

… issues… 🙁

The next couple of days I will be abroad, but I’ll dive into this as soon as I can.

Want to know more, or did any questions come up when you were reading this? Do you have some feedback for me? Leave a comment or drop me an email.

Until the next time, keep it cloudy!

Bert Wolters
http://www.twitter.com/BertWolters

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.