Skip to main content
Azure Bicep is a domain-specific language (DSL) for authoring Azure resource deployments with a concise, readable syntax that compiles to ARM JSON. This article explains the core benefits of Bicep, shows a side-by-side example (ARM JSON → Bicep) for a Storage Account, and demonstrates how to deploy the Bicep file with both Azure CLI and PowerShell (including the common PowerShell caveat). Benefits of using Bicep
  • Easier to read and author than raw ARM JSON templates.
  • Native support for modularization so you can break templates into reusable modules.
  • Automatic dependency detection between resources (no need to manage explicit dependsOn in many cases).
  • First-class tooling: VS Code extension with IntelliSense, snippets, linting, and diagnostics.
A presentation slide titled "Consider Azure Bicep Files." It lists four benefits: simpler syntax compared to ARM templates, smaller module files, auto-detect dependencies, and a VS Code extension to make authoring smooth and seamless.

Example: Storage Account

Below is a cleaned and corrected ARM JSON template that defines parameters, a variable and a storage account resource. This represents the “before” template that Bicep aims to simplify.

Deploying the ARM template (PowerShell interactive)

When you deploy this ARM template using Azure PowerShell, the cmdlet will prompt you for parameters if not provided in a parameter file or inline. Example interactive attempt:
After supplying a valid part value (for example we45), the deployment can succeed:

Equivalent Bicep file

Converting the same template to Bicep produces a much shorter file with the same semantics. Save this content as storage.bicep.
Bicep compiles to ARM JSON behind the scenes, so the resource created is identical to the ARM template version.
If you use the Azure CLI, it includes a Bicep interpreter by default and can deploy .bicep files directly with az deployment commands. If you use Azure PowerShell, the cmdlets will try to call the bicep CLI on your machine. If the Bicep CLI is missing or not on PATH, PowerShell will return an error instructing you to install Bicep.

Common PowerShell error when Bicep CLI is missing

  • Fix options:
    • Install the Bicep CLI directly: https://aka.ms/bicep-install
    • Use Azure CLI to deploy the .bicep file without installing the Bicep binary separately.

Deploying the Bicep file with Azure CLI

  1. (Optional) Confirm and set the subscription context:
  1. Deploy the storage.bicep file to an existing resource group, passing the part parameter:
Quick reference table of common deployment commands After deployment completes, verify the storage account in the Azure portal (Storage accounts blade). The screenshot below shows a list of storage accounts, including the one created from the Bicep deployment.
Screenshot of the Microsoft Azure portal showing the "Storage accounts" blade with a list of storage accounts, their types, resource groups, locations, and subscriptions. Five StorageV2 accounts are displayed in list view (e.g., about-rithin, st889bicepres).

Summary

  • Bicep simplifies authoring and maintenance of Azure resource deployments compared to ARM JSON while retaining full parity with ARM.
  • Bicep supports parameters with validation attributes, variables, and concise resource syntax—reducing verbosity and improving readability.
  • Use Azure CLI to deploy .bicep files without extra tooling. PowerShell users should ensure the Bicep CLI is available on their system or use Azure CLI where appropriate.

Watch Video

Practice Lab