In Azure, all the resources can be described as JSON and deployed through Azure Portal, PowerShell, Azure CLI and Rest Client.
Those interfaces all interact with the Azure Reousrce Manager (ARM) to deploy the resources.
In Azure, under management groups you can have different subscriptions and resource groups. They can be created through commands as well, but the focus of ARM is for the resources under resource groups.
The benefit is when deploying a resource from Dev to Prod for example, no need for manual clicking, and template makes sure the accurately deployed.
The basic structure of the JSON template is as below. The schema specifies the expected fileds.
The resources simply list each of the resources you want to deploy. Every resource has it's own fields for specification, check Microsoft website for details.
The parameters helps to reduce hardcoding stuff in the template, but leave it to the deployment run to provide the parameter, e.g. redundancy strategy, local or geo-redundancy
Work in VS Code
Install addons for ARM, which are Azure Resource Manager (ARM) Tools, and ARM Template Viewer. They provide support for ARM template development, and the viewer also shows a fancy graph of the resources and dependencies.
You can create a Json file for each resource, or a Json file for all resources. You can even specify reference and dependencies between Json files for ARM as well.
In the Json file, type in "arm", the intellisense will bring up the different options for building ARM template, simply hit TAB to create the scaffold.
Then expand the resources field, type in 'arm-storage' for example, and hit TAB to insert the template for a storage account.
Below is what is created by the tool.
Deploy ARM template
Create a Powershell script .ps1, and add commands to create new resource group and deploy the ARM template json file.
Note, if there is a change to the ARM template, the new deployment will update the existing resources, so this helps a lot in devops. You don't need to delete and create again, but just deploy incrementally.