Blog Azure Infrastructure Modernization

Master the Basics of Azure Bicep: How To Start Deploying

Microsoft introduced Azure Bicep in August 2020 during Microsoft Ignite.  

It offers a simpler and more user-friendly alternative to Azure Resource Manager (ARM) templates for deploying Azure resources. 

In this article, you’ll learn what Azure Bicep is, the benefits, when to use it (and when not) and how to get started deploying Bicep files with a quick demo.  

Niels Kroeze

Author

Niels Kroeze IT Business Copywriter

Reading time 9 minutes Published: 26 August 2025

What is Azure Bicep? 

Azure Bicep is a domain-specific language (DSL) that’s used to deploy Azure resources declaratively. 

Azure Bicep logo and text explaining its definition for deploying Azure resources

This means you can’t use Bicep for deploying non-Azure resources, and it doesn’t work in other cloud providers (like AWS or GCP).

Azure Bicep builds on existing tool sets, as it leverages the Resource Manager Template language that we already use within Azure. However, it’s a lot easier and more straightforward to learn than Azure ARM templates. 

 

Benefits of Azure Bicep 

This is what Azure Bicep brings to you and why you’d want to use it within your environment to try and deploy resources: 

Simpler Syntax. No JSON noise 

With Azure Bicep, you can define Azure resources using a simple language to learn, read and understand. It is significantly simpler and easier to learn than Azure ARM templates. 

You only have to look at the examples below to compare the simplicity of a Bicep file and its equivalent ARM JSON template, both deploying a storage account: Comparison of Bicep and ARM templates showing Bicep as significantly shorter.

Declarative Syntax 

Declare how the resources should be, and Azure Resource Manager “makes it so”. 

Modularity 

One of Azure Bicep’s most powerful features lies in its modularity. You can use modules to break your bicep code into manageable and standardised building blocks that can be reused across your organisation. This ensures consistency, reduces duplication, and streamlines the management of complex configurations. 

Iac Whitepaper

Do you want to learn how to create reusable Azure Bicep modules?

Master modular Bicep with our Infrastructure as Code (IaC) whitepaper. Learn how you can keep your infrastructure standardised, scalable, and manageable with reusable Azure Bicep modules.  

Download the IaC whitepaper for free!

Built for tool-ability 

Creating Azure Bicep templates gets easier when you combine it with Visual Studio Code (VS Code). You can download the Bicep Extension for VS Code, which provides a first-class authoring experience: 

  • IntelliSense: The extension includes great IntelliSense, which you can install within Visual Studio Code.  
  • Visualisation: Visualisation tools to help you understand and navigate your template structure. 
  • Syntax validation: It also has syntax validation. 

Convert existing templates 

If you have spent a lot of time and effort learning Azure ARM templates and have a great resource of them stored for use, you don't have to scrap all the work and start all over again. 

You can quite easily convert Azure Resource Manager (ARM) templates into Bicep templates with a single command line

Open-Source and Free 

As a first-party product from Microsoft, Azure Bicep is 100% free. And because it’s open-source, you can obtain the source code from GitHub and contribute to it, adding features if you like. 

Repeatable deployments 

Bicep files are idempotent, meaning you can deploy the same file multiple times and achieve the same resources in the same state.  

Bicep

param location string = resourceGroup().location 

resource mystore 'Microsoft.Storage/storageAccounts@2023-05-01' = { 
  name: 'mystorageaccount' 
  location: location 
  sku: { 
    name: 'Standard_LRS' 
  } 
  kind: 'StorageV2' 
} 

If you deploy the template and storage account again with the same properties, no changes are made.

Integration services 

Bicep works well with other Azure services, including Azure Policy, template specs, and Deployment Stacks

 

When is Azure Bicep the right tool? 

When you're looking for Infrastructure as Code (IaC) tools for your environment, it can often be tricky to pick the right tool for your use. There is simply no silver bullet. 

Instead, figure out what you need from a tool and then find the one that suits your needs and is already available in the market. 

Azure Bicep is the right tool for you if you're looking for something that is fully supported by Microsoft. When you encounter an issue with a Bicep template or deployment, you can log a ticket with Microsoft support. 

But there are more reasons to go for Azure Bicep: 

  • Azure Native: When new Azure resources are leased or updated, Bicep will support those new Azure products or features from day one. 
  • Easy transition from JSON: If you’re already using Azure ARM JSON templates, you can easily transition to Azure Bicep templates. 

 

When is Azure Bicep not the right tool? 

Screenshot of Bicep code with a red prohibition symbol and text stating "When You Shouldn't Use Azure Bicep!!".

Azure Bicep isn’t always the right tool for your setup, like when: 

  • Operating in multi-cloud environments: Since other cloud providers don’t support Azure Bicep language, it is not the best choice for multi-cloud setups. Another IaC tool, such as Terraform might be a better fit for such a scenario. 
  • Having an existing tool set: If you already have an existing IaC tool, it may make sense to continue using it instead. You don't necessarily have to change if you have made a significant investment (financially and knowledge base-wise) 
Iac Tools

Not sure which IaC Tool to use?

Read about the many popular IaC tools, including ARM, Bicep & Terraform.

Read the article!

Get started with Azure Bicep

Step 1: Install Azure Bicep 

Before you can create and deploy Bicep files, you must first install some tools: 

  • Install Bicep software 
  • Azure CLI or Azure PowerShell module 
  • Visual Studio Code & Extension for Bicep 

 

Azure CLI 

When you use Azure CLI with Bicep, it provides everything needed to deploy and decompile Bicep files. The Azure CLI automatically installs the Bicep CLI the first time you run a command that requires it. 

Note:

You need Azure CLI version 2.20.0 or later installed. 

To install or update the Azure CLI on different operating systems, refer to: 

To check your current Azure CLI version, run the following version command:

Azure CLI 

az --version 

To confirm that the Bicep CLI is properly installed, run the Bicep version command. 

Azure CLI

az bicep version 

If you want to upgrade to the latest Bicep CLI version, use the upgrade command. 

Azure CLI 

az bicep upgrade 

After this, you’re done with setting up your environment. The following installation steps don’t apply when using Azure CLI. 

 

Azure PowerShell 

Like Azure CLI, Azure PowerShell is a collection of modules built for deploying and managing Azure resources. But unlike Azure CLI, Azure PowerShell does not install the Bicep CLI automatically. You must install it manually instead.

Note:

If you use Azure PowerShell, you need version 5.6.0 or later.  

When you install the Bicep CLI manually, run Bicep commands directly using the bicep syntax instead of the az bicep syntax used with Azure CLI.  

To check your Bicep CLI version after manual installation, run: 

Windows Command Prompt

bicep --version 

Alternatively, Microsoft provides instructions on how to install Azure Bicep manually for Windows, Linux, and macOS

 

Visual Studio Code and Bicep Extension 

To create Bicep files, you need a reliable editor. We recommend: 

  • Visual Studio Code: Install it here if you don’t already have it.
  • Bicep extension for Visual Studio Code: This adds language support and resource autocompletion. It helps you write and validate Bicep files efficiently.  

You can install the Visual Studio Code Extension by searching for Bicep in the search bar.  

The Bicep extension for Visual Studio Code is shown with its logo, name, and installation status.

Learn how to install the Bicep extension.

 

Step 2: Create Azure Bicep Files 

Once you’ve installed the required Azure CLI version or PowerShell module, the Visual Studio Code and the Bicep Extension, you can start creating your Azure Bicep files. 

Add resource snippet 

Visual Studio Code with the Bicep extension IntelliSense (predefined snippets) make development easier. We start by adding a snippet to create a virtual network (VNET). 

  • Open Visual Studio Code 
  • Create a new file named main.bicep 
  • In main.bicep, type in vnet, select res-vnet from the available options and press either TAB or ENTER

Visual Studio Code interface showing Bicep code with "vnet" and "res-vnet" highlighted within a list of Azure resource definitions.

Your Bicep file should now look like this: 

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = { 
  name: 'name' 
  location: location 
  properties: { 
    addressSpace: { 
      addressPrefixes: [ 
        '10.0.0.0/16' 
      ] 
    } 
    subnets: [ 
      { 
        name: 'Subnet-1' 
        properties: { 
          addressPrefix: '10.0.0.0/24' 
        } 
      } 
      { 
        name: 'Subnet-2' 
        properties: { 
          addressPrefix: '10.0.1.0/24' 
        }    
   } 
    ] 
  } 
} 

You’ll see that your Bicep file contains two underlines: 

  • Yellow underline: a warning that the API version is outdated. 
  • Red underline: an error, as a required parameter is missing. 

This is because the Bicep linter checks for syntax and best practice violations. If you hover over @2019-11-01, a popup suggests: Use more recent API version for 'Microsoft.Network/virtualNetworks'. Select Quick fix, then replace with the latest version.

This updates to the latest API version. 

 

Add parameter 

The code snippet from the last section is missing a required parameter: location. This is why you see a red underline. To fix it, add the following line at the top of your file: 

Bicep

param location 

When you type a space after location, IntelliSense will suggest available data types. Choose string. See image below: 

Screenshot of code with a dropdown menu highlighting "string".

Then, set this default value: 

Bicep 

param location string = resourceGroup().location 

This sets the location of the virtual network to match the resource group's location.  

Next, add another parameter at the top of the file for the storage account name. You'll use this later: 

Bicep 

param storageAccountName string = 'store${uniqueString(resourceGroup().id)}' 

The storageAccountName parameter works, but storage accounts have strict naming rules. The name must be between 3 and 24 characters long. You can enforce this by adding decorators to the parameter. 

Azure Bicep extension in Visual Studio Code editor displaying decorators with with maxLength and minLength options highlighted.

Above the parameter, type @ to view available decorators. Use @minLength and @maxLength to set the limits: 

Bicep

@minLength(3)
@maxLength(24)
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'

You can also add a description to explain the naming rules, which is helpful for others to understand the Bicep file: 

Bicep 

@minLength(3) 
@maxLength(24) 
@description('Provide a name for the storage account. Use only lowercase letters and numbers. The name must be unique across Azure.') 
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}' 

These parameters are now ready for use in your deployment. 

 

Add resource 

Instead of using a snippet to define the storage account, you can use IntelliSense to fill in the values, which is way faster and reduces manual typing. 

To define the resource, use the resource keyword. Type this below your virtual network definition: 

Bicep

resource storageAccount

Screenshot of selecting storage accounts for resource type

After choosing Microsoft.Storage/storageAccounts, IntelliSense will list the available API versions. Again, select the most recent one. 

After selecting the resource type, add = and a space.  
IntelliSense will show options for what you can add next. 

Choose required-properties.  

Screenshot of adding required properties

This inserts all the minimum properties needed to deploy the storage account. 

After selecting it, your resource will contain the following properties: 

Bicep 

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
  name:
  location:
  sku: {
    name:
  }
  kind:
}

All that’s left is providing values for the properties (use IntelliSense for this) which will result in this: 

Bicep

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = { 
  name: storageAccountName 
  location: location 
  sku: {
name: 'Standard_LRS' 
} 
  kind: 'StorageV2' 
} 

In the end, your code should look like this: 

Bicep 

@minLength(3)
@maxLength(24)
@description('Provide a name for the storage account. Use only lowercase letters and numbers. The name must be unique across Azure.')
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
param location string = resourceGroup().location

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2024-05-01' = {
  name: 'exampleVNet'
  location: location
  properties: {
    addressSpace: {
      addressPrefixes: [
        '10.0.0.0/16'
      ]
    }
    subnets: [
      {
        name: 'Subnet-1'
        properties: {
          addressPrefix: '10.0.0.0/24'
        }
      }
      {
        name: 'Subnet-2'
        properties: {
          addressPrefix: '10.0.1.0/24'
        }
      }
    ]
  }
}

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
  name: storageAccountName
  location: location
  sku: {
    name: 'Standard_LRS'
  }
  kind: 'StorageV2'
}

And that’s all.

You’ve now learned how to define parameters and deploy a VNET and storage account using Azure Bicep. 

Marc Bosgoed

Get in Touch!

Want to simplify your Azure deployments through IaC with Azure Bicep? At Intercept we can help you with consistent, optimised, and managed Azure deployments.