Skip to the content.

Welcome to my Reusable Bicep Modules pages!

This project is an effort to create reusable Bicep modules. Focus lies on researching reuse, not on actually creating a library.

Abstract

This is a collection of ideas on how to create reusable Bicep modules. Currently, these are the basic concepts:

Background and Motivation

Bicep is a big improvement compared to directly deploying ARM templates. Apart from being much more readable, it wants us to reuse stuff by introducing modules. But as it turned out during the last 2 years, real reuse still is quite hard to achieve.

I think that reusability cannot be achieved by specifying parameters as primitive values.

Why is this not a good idea:

The last point is the most important one as it is the death of reuse.

The solution described here exposes template fragments as parameters. Maybe this is also not ideal for other reasons. Nevertheless, I gave this a try and share the results here.

The repository on which this site is based, contains the current state of the implementation.

Currently, the NIC assembler is the most complex one as it assembles a lot of resources and solves the problem of optionally assigning resources. It also lets you choose between assigning existing or newly created resources for assignment. A detailed description of its code is here. Other assemblers still habe to be leveled up.

Currently Available Modules

Here’s a list of the currently available modules and their reuse by parent-modules:

A small collection of links on Bicep that I found very helpful:

This is only a small and very personal selection. The Microsoft documentation is very good and there are a number of great books on Bicep available by now.

Utility commands

// What is my current tenant:
az account show

// list all my accouts
az account list
// attach a default subscription to an account
az account set --subscription <my subscription>

Disclaimer

Things to notice:

home design decisions deployment implementations