- Designed to represent each service in Azure as a resource provider and each service instance in Azure as a modular resource.
- JSON templates are used to deploy collections of resources using Infrastructure-as-Code concepts.
- You can interact with Resource Manager using PowerShell, CLI, Client libraries, Visual Studio, Portal, REST API.
- Common lifecycle for resources: They can be created, managed, monitored, or deleted together.
- The Resource Manager also offers the concept of resource group templates
- You define a service unit in advance, and then use the template to create as many resource groups as you need.
- 💡 Envision your solution using ARM
- Start by designing and conceptualizing your entire solution considering all components that may compose your solution.
- Then identify individual units of functionality and find resources available on Azure that can facilitate the specific functionalities.
- Resource : Single service. E.g. web app, app service plan, SQL database.
- Resource group : Logical grouping of resources.
- Resource group template : JSON file that describes a set of resources.
- Some or all of the properties of the resource can be parameterized so that you can customize your deployment by providing parameter values at deployment time.
- Deployment
- ARM Templates are deployed in a few ways.
- These depend on your aims, the result intended and your chosen method for development.
- A developer may choose to use Visual Studio to create and deploy ARM templates directly and to manage the lifecycle of the resources through Visual Studio.
- An administrator may choose to use PowerShell or the Azure Command Line to deploy resources and amend them.
- An end user without command line or developer skills would choose to use the Azure Portal to deploy resources without realizing a template is involved. E.g. marketplace offerings.
- ARM Templates are deployed in a few ways.
- Advantages:
- Ensure idempotency : Identical template to multiple resource => same functionality.
- Simplify orchestration : Automatize.
- *Configure multiple resources : Order, fix dependencies.
- Parameterize : Define input & input for reuse. Can be nested for larger orchestration.
- Template resources: Parameters (=> Variables ) => Resources => Output
-
📝 Empty ARM template:
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { }, "variables": { }, "resources": [ ], "outputs": { } }
-
Required:
content
,resources
-
Optional:
parameters
,variables
,output
. -
Sources:
- The Azure Quickstart templates on Github are
- Inspect Automation script element of objects.