What is BRI?
BRI stands for Bicep registry inventory, and it does exactly what the name suggests: it scans a provided Azure Container Registry for any published Bicep modules and generates markdown files for each module version. These markdown files contain information about the module's input parameters, output values, and example usage. You can then use these files with any static site generator that supports markdown, such as Statiq, to create a beautiful documentation site for your modules.
How to use BRI?
BRI is very easy to use. You just need to install it from NuGet.org using the .NET SDK tool install command. It supports both .NET 7 and .NET 8, and you can install it globally or locally. For example, to install it globally, you can run:
dotnet tool install --global BRI
Or, to install it locally (tool manifest), you can run:
dotnet tool install --local BRI
Once installed, you can run BRI by typing (
dotnet bri if installed locally):
bri inventory <container registry name> <output path>
For example, to scan the container registry named myregistry.azurecr.io and generate markdown files in the ./output/path folder, you can run:
bri inventory myregistry.azurecr.io ./output/path
You can see an example of the output that BRI generates at www.devlead.se/bri/ .
By default, it'll try to authenticate using the DefaultAzureCredential which tries to authorize in the following order based on your environment.
If running in a DevOps pipeline recommended way is to use a managed/workload identity, or create an Entra ID service principal and set the following environment variables fetched from pipeline secrets
AZURE_TENANT_IDto its tenant ID
AZURE_CLIENT_IDto its client ID
AZURE_CLIENT_SECRETto its secret.
Where to find BRI?
Feedback and suggestions
I hope you find BRI useful and that it helps you with your Bicep module development. If you have any feedback or suggestions, please feel free to open an issue or a pull request on GitHub. Happy coding!
This post is licensed under a Creative Commons Attribution 4.0 International License