Azure Resource Manager - barialim/architecture GitHub Wiki

Table of Content

Table of contents generated with markdown-toc

Infrastructure as Code (IaC)

With the move to cloud, you can automate application infrastructure deployments using the practice of Infrastructure as Code (IaC).

In code, you define the infrastructure that needs to be deployed. The infrastructure code becomes part of your project. Just like application code, you store the infrastructure code in a source repository and version it. Any one on your team can run the code and deploy similar environments.

To implement infrastructure as code for your Azure solutions, use Azure Resource Manager templates (ARM templates).

ARM Template

ARM template is Azure solution IaC framework.

The template is a JSON file that defines the infra and configuration for your project. In the template, you specify the resources to deploy and the properties for those resources.

Under the hood

When you deploy a template, Resource Manager converts the template into REST API operations. see example here.

Option to deploy ARM

  • Azure portal
  • Azure CLI
  • PowerShell
  • REST API
  • Button in GitHub repository
  • Azure Cloud Shell

ARM Template best practices

See Template design here for best practices.

Bicep

Azure introduced a new language named Bicep that's used to develop ARM template JSON. Bicep files and JSON templates offer the same capabilities. You can convert templates between the two languages. Bicep provides a syntax that's easier to use for creating templates. For more information, see What is Bicep?.

Dependency in ARM template

ARM template has concept of dependency when deploying resources. Hence, some resources cannot be deployed until another resource exists. For example, you can't create the virtual machine until its storage account and network interface exist. You define this relationship by making one resource as dependent on the other resources.

The following diagram illustrates the resources and the dependency information for this template:

ARM Template dependency

Resource Manager evaluates the dependencies between resources, and deploys them in their dependent order. When resources aren't dependent on each other, Resource Manager deploys them in parallel. For more information, see Define the order for deploying resources in ARM templates.

Example of Resource dependency

  • Microsoft.Compute/virtualMachines - cannot create virtual machine until its Microsoft.Storage/storageAccounts and Microsoft.Network/networkInterfaces exist.
  • Microsoft.Network/networkInterfaces - cannot create network interface until its Microsoft.Network/publicIPAddresses and Microsoft.Network/virtualNetworks exist.
  • Microsoft.Network/virtualNetworks - cannot create virtual network until its Microsoft.Network/networkSecurityGroups exist.

See Template dependency for more info.

Terminology

⚠️ **GitHub.com Fallback** ⚠️