Introduction
Sometimes, your Bicep code isn't deployed directly to Azure. Instead, you might want it to be reused in multiple deployments. Azure template specs enable you to create reusable deployments for complete solutions. Bicep modules and registries enable you to create components that you can add to other Bicep deployments.
Publishing reusable Bicep code comes with different concerns than normal Bicep deployments. In this Microsoft Learn module, you'll learn how to automate the validation and publishing of your template specs and Bicep modules.
Example scenario
Suppose you're the Azure administrator at a toy company. The company's use of Azure is expanding. The company has introduced a new cloud governance approach to ensure that your deployments follow Microsoft's recommended practices for security and reliability.
To make it easy for your colleagues, you create a set of security-hardened Bicep files. Some of the files deploy complete solutions that your colleagues need. Other files define sets of resources that your colleagues can use within their own Bicep deployments.
You previously used Azure Pipelines to automate the deployment of your Azure resources. Now, you want to find a way to automate the validation and publishing of your reusable Bicep code.
What will you learn?
In this module, you'll learn to publish reusable Bicep code from a deployment pipeline. You'll also learn how your pipeline securely identifies itself so that it can publish your code. And finally, you'll learn how to perform code validation and versioning within an automated deployment process.
You'll create deployment pipelines to publish two Bicep files: one as a template spec, and another as a module to a private Bicep registry.
What is the main goal?
After you complete this module, you'll be able to publish reusable Azure template specs and Bicep modules from your deployment pipelines.
If you need a refresher on Bicep modules, registries, or template specs, see these Microsoft Learn training modules:
- Create composable Bicep files by using modules
- Share Bicep modules by using private registries
- Publish libraries of reusable infrastructure code by using template specs