Reading Time: 3 minutes

Hey there! If you’re exploring Infrastructure as Code with Azure, you might have encountered Azure Verified Modules. These are pre-checked, reusable building blocks in languages like Bicep and Terraform, making it easy to set up and manage Azure resources.

Microsoft has tested and verified these modules to ensure high quality and security, so you can trust them in your projects without worrying about the details.

Using Azure Verified Modules saves you time. Instead of creating reusable code from scratch, you can use these ready-made components to get things running quickly. They also help you follow Azure best practices like the Well-Architected Framework, keeping your setup consistent and secure.

Maintained and supported by Microsoft, the library of modules is constantly growing, offering more options over time.

In this post, I’ll guide you on how to begin using these modules to create resources or refactor your existing code to incorporate them.

Getting your local development machine ready

To prepare your environment, you simply need to have the following software:

  • Latest build of Visual Studio Code
  • Latest version of Bicep VS Code extension

I’ve previously made this guide that can be of assistance Install Bicep tools using WinGet – George Markou.

Know the available Azure Verified Modules for Bicep

As mentioned, not every resource has an Azure Verified Module, so you first need to get acquainted with the available modules. Bicep Modules .

In the list above, you will see that there are two main categories of verified modules. The Module Classification page is quite self-explanatory, but let me break it down for you quickly.

  1. Resource Modules: These modules are designed to deploy a single primary resource, which may include other related resources. They are the building blocks for creating specific Azure resources.
  2. Pattern Modules: These modules are used to deploy multiple resources. They can vary in size but are intended to accelerate common tasks, deployments, or architectural patterns.
  3. Utility Modules: Modules used to implement a function or routine that can be flexibly reused in resource or pattern modules – e.g., a function that retrieves the endpoint of an API or portal of a given environment.

Getting started

To get started, follow these steps:

  1. Start with an existing or new .bicep file in VSCode.
  2. Specify the scope for the deployment if it differs from the default resource group.
  3. Begin by typing the keyword module, followed by a symbolic name for the resource. Hit space, and you will be given the following two options:
    • Let IntelliSense kick in and choose the public Bicep registry br/public:avm. Then, type the resource type name followed by the version number as shown below. Don’t worry about memorizing resource type names and versions; let IntelliSense do the work for you.
    • Or type the explicit path to the AVM module.
  4. Choose the required parameters and start filling them out.

Each verified module presents a set of options for the exposed parameters. For example, if we delve into the AVM module for a resource group, as with any AVM module, you will discover a set of usage examples. These examples involve the minimum set of required parameters, fully detailed parameters, and proposed parameters that align with Well-Architected Framework principles.

Conclusion

Azure Verified Modules offer a streamlined and efficient way to manage your Azure resources. By leveraging these pre-checked, reusable building blocks, you can save time, ensure high-quality deployments, and adhere to best practices like the Well-Architected Framework. What I really love about using Azure Verified Modules is that you are never left in the dark when a new module version is released, you can stick with a previous version if needed. Additionally, the use of user-defined types allows you to navigate complex data types like objects and arrays with ease.

As Microsoft continues to expand the library of available modules, you’ll have even more tools at your disposal to enhance your infrastructure as code projects. Currently, the number of available Bicep modules outnumbers those for Terraform, but Microsoft is heavily investing in enriching and developing this promising code base.

Happy coding!