Ability to export a Resource Group as a template
When doing work which needs to be repeating, i.e. deploying a large set of servers, configuring a complex set of dependencies, it would be very helpful to have the ability to save the resource group as a template, which could then potentially be used in the Azure Resource Manager within Visual Studio to be further refined for argument usage. The use case for this would be dev/test environments, where we need the ability to fully tare down and re-create the environment. This feature would build on top of the current ability to execute Save-AzureResourceGroupGalleryTemplate.
You can now export a template from your existing resource groups. We’re still evolving this experience, but try it out and let us know what you think!
Great that you've started. When are you going to do the first release?
Works perfectly. Missing the follwoing 2 schemas:
"Schema for type 'Microsoft.Compute/virtualMachines/extensions'
"Schema for type 'Microsoft.Network/virtualNetworkGateways'
Topology would be more relevant to my current requirements.
From my perspective, I have a need for both. Topology to begin with, but with an option for runtime state.
Thanks Ryan, I would like to be able to export the resources as a template, so "topology" is the best choice for now. I think it could be the first step to publish our application to azure marketplace.
Brett Hacker commented
Topology. I'd like to manually tweak the resources until they're doing what I want, then export that template so I could then, for example, recreate that environment, empty, for another customer.
Anders Liu commented
Hi @Craig, thanks for trying it out! It should be able to capture all v2 compute/network/storage resources. I was able to capture VNet for my own testing. Please send the error/problem you saw to me (email@example.com), I'd love to investigate.
Hey @Anders Liu, i've just tried your website to capture Azure Resource Groups! Fantastic little tool! Although it doesn't seem to be able to capture VNets?
Anders Liu commented
Hi folks, just let you know that we have made some progress here. An prototype to capture resource group topology as template is available here: https://capturegroup.azurewebsites.net/
You can sign-in using your organization account (Live Id not supported for this prototype). Simply select your resource group and click the 'Capture' button, you will get a template that has parameterization for resource names, and also with dependencies set. Please let us know how you like this and any feedbacks is appreciated!
James Miera commented
Primarily, the ability to capture topology from an existing resource group into a template would be awesome. It would also be nice to capture/generate parameters.json too.
I like the concept and how it works, but really love to see the cloud services and other PaaS to be included in here. not just VM's, etc..
Mark Lewis commented
For me, I would love this. I have just finished sorting out a lab environment for an exam, Although I have now seen how I envisage it looking, It would be nice to export it so that I have a clean base for labs. I will learn about authoring my own templates but would have been nice to have this as a base to work from
Stephane Lapointe commented
Topology for me too.
When building complex and complete environments sometime it's faster to perform your action in the portal or in PowerShell to then have the ability to "snapshot" the topology into a template
Topology option would be a brilliant offer for the majority of automation projects.
Andreas Bohn commented
From my point of view it's the topology.
It's sometimes just simpler to go to the preview portal, create a brand new resource group and create all the resources you want, especially with all the little settings on web apps, databases et al. All the settings, i.e. scaling rules, web tests, alerts, backup options and so on could be done in the Web UX, which is just simpler most of the time.
After we're done, we should be able to capture the definition of the whole resource group with all it's details and condense it into an ARM template which we can download.
Loading a ready made ARM JSON resource template and edit it for parameterization and customization would be a breeze compared to write it all up front with all the details; especially because you already know what everything is and what it's all about.
This would be an awesome feature.
Neil G. commented
It would seem that run-state would be more of a backup issue and less of a deployment issue .
Unless by runstate you included things like what extensions are enable for a WebApp, what ACL or RBAC controls are on a resource, etc. -- that kind of "run-state" should be captured.
Note: Obviously we would like for this to be a feature for existing resources, but if its something you can only quickly solve for new resource objects going forward that would be better than nothing.
i.e. If you somehow added the data into the audit trail and then scavenged the audit logs nightly to create a resource template with versioning, that would be great but clearly wouldn't help for existing production apps.
Still it would "stop the bleeding" so at least new deployments would get the ad-hoc resource template capability.
Since we have little to no useful documentation on how to use templating and just what dependencies it takes to build something, this would be the most obvious next choice for us to be able to attempt to resolve said situation.
Michael Teper commented
Can't speak for the original requestor, but our use case would be the "topology".
I guess this is a common use case:
You start by creating an infrastructure environment by playing around with the web GUI, using trial-and-error until you get what you want.
This is of course an anti pattern (called "snow flake" servers), and instead you want to recreate the whole infrastructure using automated scripts. It would be convenient to be able to generate such scripts automatically.
It would be desirable if such generated scripts would be readable, and easy to maintain. Many times I've seen very little effort spent on code generators, and the generated code is then plain horrible.
If I create 5 servers and some other infrastructure, it should not be more than lets say 50 lines of json. 500 lines of json is bloated fail.
André Leite commented
I was just wondering about that and was expecting this feature to exist already.