Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Bicep CLI directly without installing binaries #1903

Merged
merged 4 commits into from Apr 9, 2021
Merged

Using Bicep CLI directly without installing binaries #1903

merged 4 commits into from Apr 9, 2021

Conversation

pinakighatak
Copy link
Contributor

Contributing a Pull Request

Added examples to show how to use Bicep CLI to transpile .bicep files directoy to ARM JSON files, without installing the binaries.

Added examples of Github workflows, and also Azure DevOps pipeline on markdown

  • I have checked that there is not an equivalent example already submitted
  • I have resolved all warnings and errors shown by the Bicep VS Code extension
  • I have consistent casing for all of my identifiers and am using camelCasing unless I have a justification to use another casing style

scriptLocation: inlineScript
inlineScript: |
az --version
az bicep build --files ./main.bicep
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to first call ‘az bicep install’ first.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you actually don't have to (though you can). If you attempt to create a deployment with a .bicep file and bicep is not installed, we will install it automatically

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, right. I just tested and it does not work with az bicep version but it does with build. Apologies for mixup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct:
using az bicep build will download the CLI if needed, and will then transpile it if needed. (See screenshot) below. So no need for the curl and extension hassle.
Although you still need to transpile to JSON to actually deploy this.

image

Copy link
Member

@anthony-c-martin anthony-c-martin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@anthony-c-martin anthony-c-martin merged commit ee17fae into Azure:main Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants