az bicep

Bicep CLI command group.

Bicep CLI command group. There are two configurations that can be set for the command group, including bicep.check_version and bicep.use_binary_from_path:

[1] az config set bicep.version_check=True/False Turn on/off Bicep CLI version check when executing az bicep commands.

[2] az config set bicep.use_binary_from_path=True/False/if_found_in_ci Specify whether to use Bicep CLI from PATH or not. The default value is if_found_in_ci.

Commands

az bicep build

Build a Bicep file.

az bicep decompile

Attempt to decompile an ARM template file to a Bicep file.

az bicep format

Format a Bicep file.

az bicep generate-params

Generate parameters file for a Bicep file.

az bicep install

Install Bicep CLI.

az bicep list-versions

List out all available versions of Bicep CLI.

az bicep publish

Publish a bicep file to a remote module registry.

az bicep restore

Restore external modules for a bicep file.

az bicep uninstall

Uninstall Bicep CLI.

az bicep upgrade

Upgrade Bicep CLI to the latest version.

az bicep version

Show the installed version of Bicep CLI.

az bicep build

Build a Bicep file.

az bicep build --file
               [--no-restore]
               [--outdir]
               [--outfile]
               [--stdout]

Examples

Build a Bicep file.

az bicep build --file {bicep_file}

Build a Bicep file and print all output to stdout.

az bicep build --file {bicep_file} --stdout

Build a Bicep file and save the result to the specified directory.

az bicep build --file {bicep_file} --outdir {out_dir}

Build a Bicep file and save the result to the specified file.

az bicep build --file {bicep_file} --outfile {out_file}

Build a Bicep file without restoring external modules.

az bicep build --file {bicep_file} --no-restore

Required Parameters

--file -f

The path to the Bicep file to build in the file system.

Optional Parameters

--no-restore

When set, builds the bicep file without restoring external modules.

--outdir

When set, saves the output at the specified directory.

--outfile

When set, saves the output as the specified file path.

--stdout

When set, prints all output to stdout instead of corresponding files.

az bicep decompile

Attempt to decompile an ARM template file to a Bicep file.

az bicep decompile --file
                   [--force]

Examples

Decompile an ARM template file.

az bicep decompile --file {json_template_file}

Decompile an ARM template file and overwrite existing Bicep file.

az bicep decompile --file {json_template_file} --force

Required Parameters

--file -f

The path to the ARM template to decompile in the file system.

Optional Parameters

--force

Allows overwriting the output file if it exists.

az bicep format

Format a Bicep file.

az bicep format --file
                [--indent-kind]
                [--indent-size]
                [--insert-final-newline]
                [--newline]
                [--outdir]
                [--outfile]
                [--stdout]

Examples

Format a Bicep file.

az bicep format --file {bicep_file}

Format a Bicep file and print all output to stdout.

az bicep format --file {bicep_file} --stdout

Format a Bicep file and save the result to the specified directory.

az bicep format --file {bicep_file} --outdir {out_dir}

Format a Bicep file and save the result to the specified file.

az bicep format --file {bicep_file} --outfile {out_file}

Format a Bicep file insert a final newline.

az bicep format --file {bicep_file} --insert-final-newline

Format a Bicep file set indentation kind. Valid values are ( Space | Tab ).

az bicep format --file {bicep_file} --indent-kind {indent_kind}

Format a Bicep file set number of spaces to indent with (Only valid with --indent-kind set to Space).

az bicep format --file {bicep_file} --indent-size {indent_size}

Required Parameters

--file -f

The path to the Bicep file to format in the file system.

Optional Parameters

--indent-kind

Set indentation kind. Valid values are ( Space | Tab ).

--indent-size

Number of spaces to indent with (Only valid with --indent-kind set to Space).

--insert-final-newline

Insert a final newline.

--newline

Set newline char. Valid values are ( Auto | LF | CRLF | CR ).

--outdir

When set, saves the output at the specified directory.

--outfile

When set, saves the output as the specified file path.

--stdout

When set, prints all output to stdout instead of corresponding files.

az bicep generate-params

Generate parameters file for a Bicep file.

az bicep generate-params --file
                         [--no-restore]
                         [--outdir]
                         [--outfile]
                         [--stdout]

Examples

Generate parameters file for a Bicep file.

az bicep generate-params --file {bicep_file}

Generate parameters file for a Bicep file and print all output to stdout.

az bicep generate-params --file {bicep_file} --stdout

Generate parameters file for a Bicep file and save the result to the specified directory.

az bicep generate-params --file {bicep_file} --outdir {out_dir}

Generate parameters file for a Bicep file and save the result to the specified file.

az bicep generate-params --file {bicep_file} --outfile {out_file}

Generate parameters file for a Bicep file without restoring external modules.

az bicep generate-params --file {bicep_file} --no-restore

Required Parameters

--file -f

The path to the Bicep file to generate the parameters file from in the file system.

Optional Parameters

--no-restore

When set, generates the parameters file without restoring external modules.

--outdir

When set, saves the output at the specified directory.

--outfile

When set, saves the output as the specified file path.

--stdout

When set, prints all output to stdout instead of corresponding files.

az bicep install

Install Bicep CLI.

az bicep install [--target-platform {linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-x64}]
                 [--version]

Examples

Install Bicep CLI.

az bicep install

Install a specific version of Bicep CLI.

az bicep install --version v0.2.212

Install Bicep CLI and specify the target platform.

az bicep install --target-platform linux-x64

Optional Parameters

--target-platform -t

The platform the Bicep CLI will be running on. Set this to skip automatic platform detection if it does not work properly.

accepted values: linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-x64
--version -v

The version of Bicep CLI to be installed. Default to the latest if not specified.

az bicep list-versions

List out all available versions of Bicep CLI.

az bicep list-versions

az bicep publish

Publish a bicep file to a remote module registry.

az bicep publish --file
                 --target
                 [--documentationUri]
                 [--force]

Examples

Publish a bicep file.

az bicep publish --file {bicep_file} --target "br:{registry}/{module_path}:{tag}"

Publish a bicep file overwriting an existing tag.

az bicep publish --file {bicep_file} --target "br:{registry}/{module_path}:{tag} --force"

Publish a bicep file with documentation uri.

az bicep publish --file {bicep_file} --target "br:{registry}/{module_path}:{tag}" --documentationUri {documentationUri}

Required Parameters

--file -f

The path to the Bicep module file to publish in the file system.

--target -t

The target location where the Bicep module will be published.

Optional Parameters

--documentationUri -d

The documentation uri of the Bicep module.

--force

Allow overwriting an existing Bicep module version.

az bicep restore

Restore external modules for a bicep file.

az bicep restore --file
                 [--force]

Examples

Retore external modules.

az bicep restore --file {bicep_file}

Retore external modules and overwrite cached external modules.

az bicep restore --file {bicep_file} --force

Required Parameters

--file -f

The path to the Bicep file to restore external modules for.

Optional Parameters

--force

Allows overwriting the cached external modules.

az bicep uninstall

Uninstall Bicep CLI.

az bicep uninstall

az bicep upgrade

Upgrade Bicep CLI to the latest version.

az bicep upgrade [--target-platform {linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-x64}]

Examples

Upgrade Bicep CLI.

az bicep upgrade

Upgrade Bicep CLI and specify the target platform.

az bicep upgrade --target-platform linux-x64

Optional Parameters

--target-platform -t

The platform the Bicep CLI will be running on. Set this to skip automatic platform detection if it does not work properly.

accepted values: linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-x64

az bicep version

Show the installed version of Bicep CLI.

az bicep version