Writing the template
From Visual Studio, when Azure SDK is installed (2.9 at the time of writing this book), you have cloud templates under the Visual C# templates tree, and the Azure Resource Group project is available:

There are many predefined templates already available to handle some generic and common deployment scenarios with typical services deployed in combinations:

To better understand how it works, we start from a blank project template. The project constitution looks like this:
It contains:
azuredeploy.json
: This is the template itself.azuredeploy.parameters.json ...
Get Mastering Cloud Development using Microsoft Azure now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.