ARM templates

A typical cloud integration solution normally consists of multiple components, such as Logic Apps, Azure Functions, API Management, SQL Server, and an API app. You will also be able to provision these tools independently through Azure Service Management APIs or PowerShell scripts.

With ARM templates, you can group all these tools collectively and use a declarative-style template written in JSON to execute the deployment of cloud services and the dependencies associated with it. If we use the same template, it allows us to deploy repetitively into various environments across the application's life cycle, which produces the same results with consistency.

The benefits of using ARM templates are as follows:

  • We can set up resource locks. This provides the option to prevent the deletion or modification of resources by other users, and more.
  • We can view the rolled-up costs of all of the resources for a resource group as they can now be grouped together.
  • We can use declarative templates, which can be managed in a source control repository.
  • We can set the sequence of provisioning resources by defining the dependencies in the template.
  • Role-Based Access Control (RBAC) is natively supported.

Pre-built templates are also community-contributed, and you can get started by modifying an existing template that closely resembles your requirements. These templates are available from here: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview.

The basic structure of an ARM template is made up of six parameters. The following table describes the elements of the template in more detail:

Element name

Description

$schema

This is the location of the JSON schema file and is a mandatory value. The file sets the rules on how the template will be processed.

Typically, this value will be set to https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json until Microsoft publishes a later version.

contentVersion

The version of the template you are authoring can be any value (for example, 1.0.0.0) and is a mandatory field. Use this to help you keep track of the template version between deployments.

Parameters

Provides the flexibility to collect user input for resource properties prior to starting the deployment.

Variables

Variables are optional. They are used to simplify the template by reusing the same variable throughout the template. The value can be a simple or a complex data type, such as another JSON object. Variable values can also be based on other values.

There are various options available when deploying these templates:

  • Azure portal: Upload the JSON ARM template into the portal for deployment
  • Azure PowerShell: You can use a local or external referenced template for deployments using the New-AzureRMResourceGroupDeployment cmdlet
  • ARM REST API: Use the APIs directly to manage the resources
  • Click to deploy: Provides the capability to deploy templates directly from GitHub
  • Microsoft Visual Studio: Directly deploys resources and groups from Visual Studio
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.109.34