az bicep

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.check_version=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

Name Description Type Status
az bicep build

Build a Bicep file.

Core GA
az bicep build-params

Build .bicepparam file.

Core GA
az bicep decompile

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

Core GA
az bicep decompile-params

Decompile a parameters .json file to .bicepparam.

Core GA
az bicep format

Format a Bicep file.

Core GA
az bicep generate-params

Generate parameters file for a Bicep file.

Core GA
az bicep install

Install Bicep CLI.

Core GA
az bicep lint

Lint a Bicep file.

Core GA
az bicep list-versions

List out all available versions of Bicep CLI.

Core GA
az bicep publish

Publish a bicep file to a remote module registry.

Core GA
az bicep restore

Restore external modules for a bicep file.

Core GA
az bicep uninstall

Uninstall Bicep CLI.

Core GA
az bicep upgrade

Upgrade Bicep CLI to the latest version.

Core GA
az bicep version

Show the installed version of Bicep CLI.

Core GA

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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep build-params

Build .bicepparam file.

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

Examples

Build a .bicepparam file.

az bicep build-params --file {bicepparam_file}

Build a .bicepparam file and print all output to stdout.

az bicep build-params --file {bicepparam_file} --stdout

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

az bicep build-params --file {bicepparam_file} --outfile {out_file}

Required Parameters

--file -f

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

Optional Parameters

--no-restore

When set, builds the .bicepparam 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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep decompile-params

Decompile a parameters .json file to .bicepparam.

az bicep decompile-params --file
                          [--bicep-file]
                          [--outdir]
                          [--outfile]
                          [--stdout]

Examples

Attempts to decompile a parameters .json file to .bicepparam.

az bicep decompile-params --file {json_template_file}

Attempts to decompile a parameters .json file to .bicepparam using the bicep file given.

az bicep decompile-params --file {json_template_file} --bicep-file {bicep_file}

Attempts to decompile a parameters .json file to .bicepparam and print all output to stdout.

az bicep decompile-params --file {json_template_file} --stdout

Attempts to decompile a parameters .json file to .bicepparam and print all output to stdout and save the result to the specified directory.

az bicep decompile-params --file {json_template_file} --outdir {out_dir}

Attempts to decompile a parameters .json file to .bicepparam and print all output to stdout and save the result to the specified file.

az bicep decompile-params --file {json_template_file} --outfile {out_file}

Required Parameters

--file -f

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

Optional Parameters

--bicep-file

Path to the bicep template file (relative to the .bicepparam file) that will be referenced in the using declaration.

--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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep format

Format a Bicep file.

az bicep format --file
                [--indent-kind {Space, Tab}]
                [--indent-size]
                [--insert-final-newline]
                [--newline]
                [--newline-kind {CR, CRLF, LF}]
                [--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.

Accepted values: 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
Deprecated

Option '--newline' has been deprecated and will be removed in a future release. Use '--newline-kind' instead.

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

--newline-kind

Set line ending characters.

Accepted values: CR, CRLF, LF
--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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep generate-params

Generate parameters file for a Bicep file.

az bicep generate-params --file
                         [--include-params]
                         [--no-restore]
                         [--outdir]
                         [--outfile]
                         [--output-format]
                         [--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

Generate parameters file for a Bicep file with specified output format. Valid values are ( json | bicepparam ).

az bicep generate-params --file {bicep_file} --output-format {output_format} --include-params {include_params}

Required Parameters

--file -f

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

Optional Parameters

--include-params

Set include params. Valid values are ( all | required-only ).

--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.

--output-format

Set output format. Valid values are ( json | bicepparam ).

--stdout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep install

Install Bicep CLI.

az bicep install [--target-platform {linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-arm64, 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-arm64, win-x64
--version -v

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep lint

Lint a Bicep file.

az bicep lint --file
              [--diagnostics-format {default, sarif}]
              [--no-restore]

Examples

Lint a Bicep file.

az bicep lint --file {bicep_file}

Lint a Bicep file without restoring external modules.

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

Lint a Bicep file with specified diagnostics format. Valid values are ( default | sarif ).

az bicep lint --file {bicep_file} --diagnostics-format {diagnostics_format}

Required Parameters

--file -f

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

Optional Parameters

--diagnostics-format

Set diagnostics format.

Accepted values: default, sarif
--no-restore

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep list-versions

List out all available versions of Bicep CLI.

az bicep list-versions
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep publish

Publish a bicep file to a remote module registry.

az bicep publish --file
                 --target
                 [--documentation-uri]
                 [--documentationUri]
                 [--force]
                 [--with-source]

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}" --documentation-uri {documentation_uri}

Publish a bicep file with documentation uri and include source code

az bicep publish --file {bicep_file} --target "br:{registry}/{module_path}:{tag}" --documentation-uri {documentation_uri} --with-source

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

--documentation-uri -d

The documentation uri of the Bicep module.

--documentationUri
Deprecated

Option '--documentationuri' has been deprecated and will be removed in a future release. Use '--documentation-uri' instead.

The documentation uri of the Bicep module.

--force

Allow overwriting an existing Bicep module version.

--with-source
Preview

Publish source code with the module.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep restore

Restore external modules for a bicep file.

az bicep restore --file
                 [--force]

Examples

Restore external modules.

az bicep restore --file {bicep_file}

Restore 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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep uninstall

Uninstall Bicep CLI.

az bicep uninstall
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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-arm64, 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-arm64, win-x64
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az bicep version

Show the installed version of Bicep CLI.

az bicep version
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.