🦾 Top 5 Azure Bicep tips & tricks to get started 🚀
Tags: devops, azure, bicep, iac
Published: 2024-02-01 10:02:27

---
title: 🦾 Top 5 Azure Bicep tips & tricks to get started 🚀
published: true
date: 2024-01-04 07:52:00 UTC
tags: devops,Azure,bicep,iac
canonical_url: https://rios.engineer/top-5-azure-bicep-tips-tricks-to-get-started/
---

Here’s my top 5 Azure Bicep tips & tricks to get you started! Be sure to have the [VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-bicep) installed.

If you’re interested in checking out some real world examples for Bicep please checkout my GitHub project Bicepify where I break down concepts into friendlier learning chunks. I update the repository frequently so be sure to star if you find it useful!

https://github.com/riosengineer/Bicepify

Now onto the first Azure Bicep tips & tricks:

## 1. Auto load required parameters from Bicep modules

Did you know you can auto-load module parameters in module blocks by simply using `CNTRL+SPACE` to auto load the `'params:`‘. This shortcut works with viewing most auto-completions in Bicep code.

![Azure Bicep tips](https://rios.engineer/wp-content/uploads/2023/09/param-auto-load.gif)

While you’re here, check out my post on how to consume Azure Bicep modules and your options: [Consuming Bicep modules – What are my options? – Rios Engineer](https://rios.engineer/consuming-bicep-modules-what-are-my-options/)

## 2. Easily import your existing Azure resources

Missing some Azure resources from your file, or maybe you are starting your IaC journey and need to retrospectively add resources? No problem in Bicep.

Locate an Azure Resource in the portal you want to import. On the overview page there is a ‘JSON View’ hyperlink, copy the Resource ID. Then in VSCode extension can do the rest:

![Azure Bicep tips](https://rios.engineer/wp-content/uploads/2023/09/import-bicep.gif)

## 3. Visualise your Azure Bicep 

You can also automatically visualise your resources by right clicking the file and select ‘Open Bicep Visualizer’. Currently no way to save these, a much requested feature though.

![Azure Bicep tips](https://rios.engineer/wp-content/uploads/2023/09/bicep-visualiser.png)

## 4. Leverage Azure Verified Modules (AVM) for Azure Bicep Modules

![](https://rios.engineer/wp-content/uploads/2024/01/image.png)

Did you know about [Azure Verified Modules](https://azure.github.io/)? It aims to set the standards for what good Infrastructure as Code modules look like and that includes Azure Bicep modules!

These Azure Bicep modules are already written for you, with Azure best practice & Bicep standards baked in by design. Using these modules will save you reinventing the wheel or wasting time writing an Azure Bicep module that most likely already exists for your consumption.

You can view the Bicep module list for use below here:

[Bicep Resource Modules | Azure Verified Modules](https://azure.github.io/Azure-Verified-Modules/indexes/bicep/bicep-resource-modules/#available-modules)

## 5. Use metadata descriptions in your Azure Bicep files

When building out your code, it’s important to label parameters with metadata descriptions so others can easily pickup and understand. It’s also best practice so a good habit to get into!

Here’s some examples:

<svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewbox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewbox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg>
```
@description('Conditional. The current date and time.')
param dateTime string = utcNow()

@description('Conditional. Location of the resource.')
param location string = resourceGroup().location

@description('Optional. ID of the log analytics workspace to be linked to the deployed.')
param linkedWorkspaceResourceId string = ''
```

And that concludes my top 5 Azure Bicep tips & tricks!

The post [🦾 Top 5 Azure Bicep tips & tricks to get started 🚀](https://rios.engineer/top-5-azure-bicep-tips-tricks-to-get-started/) appeared first on [Rios Engineer](https://rios.engineer).