Friday, October 2, 2015

Azure Resource Manager - Linking Templates

This summer, we wrote a whitepaper named «Cloud Consistency with Azure Resource Manager» that you can download from here: https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775

This whitepaper will soon be updated with new content, more examples and guidance around best practices for template authoring.

In the meantime I’ve been writing some templates that can be used by you to learn how you can link templates to have a nested deployment.

The basic example is available on GitHub - https://github.com/krnese/AzureDeploy/tree/master/Basic



You can explore all templates, but in essence I’m doing the following:

·         Have a dedicated template for storage that takes some input parameters and can be used separately
·         Have a dedicated template for virtual network that takes some input parameters and can be used separately
·         Have a master template that also contains compute, vNic and publicIP resource types that links to the storage and vnet templates

Again, this is a very easy example and I will provide you with a more advanced example in a couple of days where we split this up even further and are able to have a much more flexible and dynamic deployment scenario around IaaS/PaaS.

Pay attention to the resource section in the azuredeploy.json document, where we are using the API version “2015-01-01” and the resource type “Microsoft.Resources/deployments”.
Here I am linking to a public Uri for the template (hosted on my github) and specify the parameters I’d like to use in my configuration.



You can hit the “Deploy to Azure” link in order to explore the json structure in Azure and do an actual deployment.



If you want do deploy it through PowerShell, you can also see that the “Microsoft.Resources/deployments” resource types are being used.


Happy authoring – and see you next time.


No comments: