Deploying from ARM and Bicep

Learn what Azure Resource Manager (ARM) templates are, how they can be compiled from Bicep, and how to deploy Cosmos DB accounts.

ARM templates

If you’re familiar with Azure, you might have encountered Azure Resource Manager (ARM) already, as it is a reliable way to deploy resources to Azure.

ARM templates are JSON documents that describe how to deploy a specific service. The properties to use differ from the parameters we use in the Azure portal, Azure CLI, and PowerShell.

The main advantages of using files and infrastructure as code (IaC) are:

  • Predictable results

  • Version control (Git)

Template creation

There are different ways to create these files with ease:

  • From the Azure portal

  • From VS Code (with extension)

  • From Visual Studio

  • From GitHub

Note: We can also create templates manually.

There are two main components for these templates:

  • The main template JSON

  • The parameters JSON

Remember: Parameterized templates make deployments in different environments much easier.

Cosmos DB template

Let’s see an example of a template for a basic Cosmos DB serverless account with one database and one container.

The file’s big but not too complicated. We can split it into three different parts:

  • Parameters

  • Variables (optional)

  • Resources

Get hands-on with 1200+ tech skills courses.