Skip to content

anthony-c-martin/bicep-ext-github

Repository files navigation

GitHub Bicep Extension

Usage

  1. Download the Samples folder, and unzip it.
  2. Open the unzipped Samples folder in VSCode, and select one of the .bicepparam files you wish to deploy.
  3. Launch the Deploy Pane to run the deployment.

Note

Extension binary packages are not signed on a Mac. If you see the following error, you will need to manually sign the extension package:

Failed to launch provider: Failed to connect to provider /Users/ant/.bicep/br/bicepextdemo.azurecr.io/extensions$github/0.1.1$/extension.bin

To work around it, run the following in a terminal window, using the path from the error message:

codesign -s - '/Users/ant/.bicep/br/bicepextdemo.azurecr.io/extensions$github/0.1.1$/extension.bin'

Build + Test Locally

Rebuild the extension

These commands publish the extension to the local file system, and updates the sample bicepconfig to point to the local extension.

./scripts/publish.sh ./bin/bicep-ext-github
jq '.extensions.github="../bin/bicep-ext-github"' ./samples/bicepconfig.json > ./samples/bicepconfig.new.json
mv ./samples/bicepconfig.new.json ./samples/bicepconfig.json

Test the extension

Run the deployment.

~/.azure/bin/bicep local-deploy ./samples/basic/main.bicepparam

To enable verbose tracing, run the following beforehand.

export BICEP_TRACING_ENABLED=true

Publishing to a registry

This repo is set up with GitHub Actions to publish a new version to an ACR on every push to the main branch.

To pick up a new version after publishing, view the Publish Extension output, and update your bicepconfig.json to use the new spec:

publish extension output

First time setup

To configure the GitHub Actions automation for the first time:

Log in to Azure CLI. Customize and run ./scripts/initial_setup.sh.

Building other extensions

This repo is also intended to demonstrate how to build + publish an end-to-end Bicep extension in C#. Feel free to copy, rename and modify it to prototype building an extension to extend other services.

About

Sample GItHub Bicep Extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •