Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 2.57 KB

README.md

File metadata and controls

61 lines (40 loc) · 2.57 KB

⬆️ 2 - Publishing a module

Description

After completing the first part we now have a Bicep Module Registry set up. Time to publish some modules!

This part will publish Bicep modules under the modules path to a Bicep registry as defined in bicepconfig.json. This is done using a GitHub Actions workflow and a wrapper script. The latest git tag will be used as the module version. In addition a 'latest' version of each module will be pushed.

To start of we have two modules:

Steps

Due to the limited regional availabilty of Azure Container Apps we want to restrict which regions this module can be used in. As an example we restrict the allowed locations to only those in the European geography.

  1. Modify the template in modules/containerapp/main.bicep.
    • Example: Update the location parameter to restrict allowed values
@allowed([
  'northeurope'
  'westeurope'
  'germanywestcentral'
  'uksouth'
])
param location string = 'westeurope'
  1. Commit, tag and push changes
git add 2-publish/modules/containerapp/main.bicep
git commit -m "fix: set allowed locations"
git tag 1.1.0
git push # push the commit
git push --tags # push the tags

This will trigger the bicep-publish workflow and publish the module to the registry.

❗ Note that each new tag pushed will trigger a new published version.

To see thew triggered run in GitHub, open your repo and go to Actions to see the latest run:

publish

To see the published modules in the registry see this guide. The module will be listed as a repository in the registry:

registry

Next Step

✔️ You've now successfully:

  • Updated a Bicep template
  • Created a new version tag
  • Published the module to the Bicep Module Registry

Continue to the next and final step to learn how to consume this module from the registry.