你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az bicep

Bicep CLI 命令组。

可以为命令组设置两种配置,包括 bicep。检查_version和bicep.use_binary_from_path:

[1] az config set bicep.执行 az bicep 命令时,检查_version=True/False 打开/关闭 Bicep CLI 版本检查。

[2] az config set bicep.use_binary_from_path=True/False/if_found_in_ci 指定是否从 PATH 使用 Bicep CLI。 默认值为if_found_in_ci。

命令

名称 说明 类型 状态
az bicep build

生成 Bicep 文件。

核心 GA
az bicep build-params

生成 .bicepparam 文件。

核心 GA
az bicep decompile

尝试将 ARM 模板文件反编译到 Bicep 文件。

核心 GA
az bicep decompile-params

将参数 .json 文件反编译为 .bicepparam。

核心 GA
az bicep format

设置 Bicep 文件的格式。

核心 GA
az bicep generate-params

为 Bicep 文件生成参数文件。

核心 GA
az bicep install

安装 Bicep CLI。

核心 GA
az bicep lint

Lint a Bicep file.

核心 GA
az bicep list-versions

列出 Bicep CLI 的所有可用版本。

核心 GA
az bicep publish

将 bicep 文件发布到远程模块注册表。

核心 GA
az bicep restore

还原 bicep 文件的外部模块。

核心 GA
az bicep uninstall

卸载 Bicep CLI。

核心 GA
az bicep upgrade

将 Bicep CLI 升级到最新版本。

核心 GA
az bicep version

显示已安装的 Bicep CLI 版本。

核心 GA

az bicep build

生成 Bicep 文件。

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

示例

生成 Bicep 文件。

az bicep build --file {bicep_file}

生成 Bicep 文件并将所有输出打印到 stdout。

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

生成 Bicep 文件并将结果保存到指定的目录。

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

生成 Bicep 文件并将结果保存到指定文件。

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

在不还原外部模块的情况下生成 Bicep 文件。

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

必需参数

--file -f

要在文件系统中生成的 Bicep 文件的路径。

可选参数

--no-restore

设置后,在不还原外部模块的情况下生成 bicep 文件。

--outdir

设置后,将输出保存在指定的目录中。

--outfile

设置后,将输出保存为指定的文件路径。

--stdout

设置后,将所有输出打印到 stdout 而不是相应的文件。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep build-params

生成 .bicepparam 文件。

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

示例

生成 .bicepparam 文件。

az bicep build-params --file {bicepparam_file}

生成 .bicepparam 文件并将所有输出打印到 stdout。

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

生成 .bicepparam 文件并将结果保存到指定文件。

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

必需参数

--file -f

要在文件系统中生成的 .bicepparam 文件的路径。

可选参数

--no-restore

设置后,在不还原外部模块的情况下生成 .bicepparam 文件。

--outdir

设置后,将输出保存在指定的目录中。

--outfile

设置后,将输出保存为指定的文件路径。

--stdout

设置后,将所有输出打印到 stdout 而不是相应的文件。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep decompile

尝试将 ARM 模板文件反编译到 Bicep 文件。

az bicep decompile --file
                   [--force]

示例

反编译 ARM 模板文件。

az bicep decompile --file {json_template_file}

反编译 ARM 模板文件并覆盖现有的 Bicep 文件。

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

必需参数

--file -f

要在文件系统中反编译的 ARM 模板的路径。

可选参数

--force

允许覆盖输出文件(如果存在)。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep decompile-params

将参数 .json 文件反编译为 .bicepparam。

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

示例

尝试将参数 .json 文件反编译为 .bicepparam。

az bicep decompile-params --file {json_template_file}

尝试使用给定的 bicep 文件将参数 .json 文件反编译为 .bicepparam。

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

尝试将参数 .json 文件反编译为 .bicepparam 并将所有输出输出。

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

尝试将参数 .json 文件反编译为 .bicepparam,并将所有输出打印到 stdout 并将结果保存到指定的目录。

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

尝试将参数 .json 文件反编译到 .bicepparam,并将所有输出打印到 stdout 并将结果保存到指定文件。

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

必需参数

--file -f

要在文件系统中生成的参数文件的路径。

可选参数

--bicep-file

将在 using 声明中引用的 bicep 模板文件的路径(相对于 .bicepparam 文件)。

--outdir

设置后,将输出保存在指定的目录中。

--outfile

设置后,将输出保存为指定的文件路径。

--stdout

设置后,将所有输出打印到 stdout 而不是相应的文件。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep format

设置 Bicep 文件的格式。

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

示例

设置 Bicep 文件的格式。

az bicep format --file {bicep_file}

设置 Bicep 文件的格式,并将所有输出打印到 stdout。

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

设置 Bicep 文件的格式,并将结果保存到指定的目录。

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

设置 Bicep 文件的格式,并将结果保存到指定文件。

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

设置 Bicep 文件的格式,插入最终换行符。

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

设置 Bicep 文件集缩进类型的格式。 有效值为 (空格 |Tab 。

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

设置 Bicep 文件要缩进的空格数的格式(仅对 --indent-kind 设置为 Space 有效)。

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

必需参数

--file -f

要在文件系统中格式化的 Bicep 文件的路径。

可选参数

--indent-kind

设置缩进类型。 有效值为 (空格 |Tab 。

--indent-size

要缩进的空格数(仅对 --indent-kind 设置为 Space 有效)。

--insert-final-newline

插入最终换行符。

--newline

设置换行符。 有效值为 (自动 |LF |CRLF |CR。

--outdir

设置后,将输出保存在指定的目录中。

--outfile

设置后,将输出保存为指定的文件路径。

--stdout

设置后,将所有输出打印到 stdout 而不是相应的文件。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep generate-params

为 Bicep 文件生成参数文件。

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

示例

为 Bicep 文件生成参数文件。

az bicep generate-params --file {bicep_file}

为 Bicep 文件生成参数文件,并将所有输出打印到 stdout。

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

为 Bicep 文件生成参数文件,并将结果保存到指定的目录。

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

为 Bicep 文件生成参数文件,并将结果保存到指定文件。

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

为 Bicep 文件生成参数文件,而无需还原外部模块。

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

为具有指定输出格式的 Bicep 文件生成参数文件。 有效值为 (json | bicepparam )。

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

必需参数

--file -f

用于从文件系统中生成参数文件的 Bicep 文件的路径。

可选参数

--include-params

设置 include 参数。 有效值为 (全部 | 仅必需 )。

--no-restore

设置时,在不还原外部模块的情况下生成参数文件。

--outdir

设置后,将输出保存在指定的目录中。

--outfile

设置后,将输出保存为指定的文件路径。

--output-format

设置输出格式。 有效值为 (json | bicepparam )。

--stdout

设置后,将所有输出打印到 stdout 而不是相应的文件。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep install

安装 Bicep CLI。

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

示例

安装 Bicep CLI。

az bicep install

安装特定版本的 Bicep CLI。

az bicep install --version v0.2.212

安装 Bicep CLI 并指定目标平台。

az bicep install --target-platform linux-x64

可选参数

--target-platform -t

Bicep CLI 将运行的平台。 将其设置为跳过自动平台检测(如果它无法正常工作)。

接受的值: linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-x64
--version -v

要安装的 Bicep CLI 版本。 如果未指定,则默认为最新。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep lint

Lint a Bicep file.

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

示例

Lint a Bicep file.

az bicep lint --file {bicep_file}

在不还原外部模块的情况下对 Bicep 文件进行 Lint。

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

使用指定的诊断格式对 Bicep 文件进行 Lint。 有效值为 (default | sarif )。

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

必需参数

--file -f

要在文件系统中 lint 的 Bicep 模块文件的路径。

可选参数

--diagnostics-format

设置诊断格式。

接受的值: default, sarif
--no-restore

设置时,在不还原外部模块的情况下生成参数文件。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep list-versions

列出 Bicep CLI 的所有可用版本。

az bicep list-versions
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep publish

将 bicep 文件发布到远程模块注册表。

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

示例

发布 bicep 文件。

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

发布覆盖现有标记的 bicep 文件。

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

使用文档 URI 发布 bicep 文件。

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

使用文档 URI 发布 bicep 文件并包括源代码

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

必需参数

--file -f

要在文件系统中发布的 Bicep 模块文件的路径。

--target -t

将发布 Bicep 模块的目标位置。

可选参数

--documentationUri -d

Bicep 模块的文档 URI。

--force

允许覆盖现有 Bicep 模块版本。

--with-source
预览

使用模块发布源代码。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep restore

还原 bicep 文件的外部模块。

az bicep restore --file
                 [--force]

示例

Retore 外部模块。

az bicep restore --file {bicep_file}

重新路由外部模块并覆盖缓存的外部模块。

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

必需参数

--file -f

要为其还原外部模块的 Bicep 文件的路径。

可选参数

--force

允许覆盖缓存的外部模块。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep uninstall

卸载 Bicep CLI。

az bicep uninstall
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep upgrade

将 Bicep CLI 升级到最新版本。

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

示例

升级 Bicep CLI。

az bicep upgrade

升级 Bicep CLI 并指定目标平台。

az bicep upgrade --target-platform linux-x64

可选参数

--target-platform -t

Bicep CLI 将运行的平台。 将其设置为跳过自动平台检测(如果它无法正常工作)。

接受的值: linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-x64
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az bicep version

显示已安装的 Bicep CLI 版本。

az bicep version
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。