Throughout all of our projects we always make sure that we are able to stand up environments for development, testing or production and ensure that we can easily automate that deployment.
On a number of projects we have found that instead of creating a number of environment templates based on variables, we take a slightly different strategy.
We create one template that is not environment specific and then create a number of parameter.json files that contain the particular environment we want to deploy.
The diagram below shows the key differences and advantages.
To implement this strategy we need an environment parameter file, we use an object within the parameter file as a universal single parameter which is used by all the templates. The functionality that ties the two artefacts together is via the dot syntax to access the associated attributes as in the example below.
Additionally ARM templates allows us structure our parameters using nested objects.