When creating reusable ARM templates you have a number of options on how to manage conditional parts in your templates. The smallest conditions can be done by parameters, medium differences can be done by  t-shirt sizes and large differences by linked templates. In this blog post I’ll show how to use implement conditions by linked templates.

Making conditions with linked templates
From one template in resource manager you can link to an other template. This enables you to decompose a large template into smaller more maintainable templates. The linking is done by the template type Microsoft.Resources/deployments. This template contains a property templateLink with the uri to the actual template.

By making the uri changeable you can chose on which template you want to load. The uri can be a variable that you compose base on a given parameter. A simple example can be:

In this template the parameter condition will choose between the uri’s:

Both templates can contain different implementations of the StorageAccount template. This technique can be used on all conditions you want to implement into your templates. It can be applied on multiple levels in your linked template tree.