az bicep
Bicep CLI 命令组。
可以为命令组设置两种配置,包括bicep.check_version和bicep.use_binary_from_path:
[1] 执行 az bicep 命令时,az config set bicep.check_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。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az bicep build |
生成 Bicep 文件。 |
Core | GA |
| az bicep build-params |
生成 .bicepparam 文件。 |
Core | GA |
| az bicep decompile |
尝试将 ARM 模板文件反编译到 Bicep 文件。 |
Core | GA |
| az bicep decompile-params |
将参数 .json 文件反编译为 .bicepparam。 |
Core | GA |
| az bicep format |
设置 Bicep 文件的格式。 |
Core | GA |
| az bicep generate-params |
为 Bicep 文件生成参数文件。 |
Core | GA |
| az bicep install |
安装 Bicep CLI。 |
Core | GA |
| az bicep lint |
Lint a Bicep file. |
Core | GA |
| az bicep list-versions |
列出 Bicep CLI 的所有可用版本。 |
Core | GA |
| az bicep publish |
将 bicep 文件发布到远程模块注册表。 |
Core | GA |
| az bicep restore |
还原 bicep 文件的外部模块。 |
Core | GA |
| az bicep uninstall |
卸载 Bicep CLI。 |
Core | GA |
| az bicep upgrade |
将 Bicep CLI 升级到最新版本。 |
Core | GA |
| az bicep version |
显示已安装的 Bicep CLI 版本。 |
Core | 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
必需参数
要在文件系统中生成的 Bicep 文件的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
设置后,在不还原外部模块的情况下生成 bicep 文件。
设置后,将输出保存在指定的目录中。
设置后,将输出保存为指定的文件路径。
设置后,将所有输出打印到 stdout 而不是相应的文件。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
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}
必需参数
要在文件系统中生成的 .bicepparam 文件的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
设置后,在不还原外部模块的情况下生成 .bicepparam 文件。
设置后,将输出保存在指定的目录中。
设置后,将输出保存为指定的文件路径。
设置后,将所有输出打印到 stdout 而不是相应的文件。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
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
必需参数
要在文件系统中反编译的 ARM 模板的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
允许覆盖输出文件(如果存在)。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
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,并将所有输出打印到 stdout。
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}
必需参数
要在文件系统中生成的参数文件的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
将在 using 声明中引用的 bicep 模板文件的路径(相对于 .bicepparam 文件)。
设置后,将输出保存在指定的目录中。
设置后,将输出保存为指定的文件路径。
设置后,将所有输出打印到 stdout 而不是相应的文件。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep format
设置 Bicep 文件的格式。
az bicep format --file
[--indent-kind {Space, Tab}]
[--indent-size]
[--insert-final-newline]
[--newline]
[--newline-kind {CR, CRLF, LF}]
[--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}
必需参数
要在文件系统中格式化的 Bicep 文件的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
设置缩进类型。
| 属性 | 值 |
|---|---|
| 接受的值: | Space, Tab |
要缩进的空格数(仅对 --indent-kind 设置为 Space 有效)。
插入最终换行符。
选项“--newline”已弃用,将在将来的版本中删除。 请改用“--newline-kind”。
设置换行符。 有效值为 (自动 |LF |CRLF |CR。
设置行结束字符。
| 属性 | 值 |
|---|---|
| 接受的值: | CR, CRLF, LF |
设置后,将输出保存在指定的目录中。
设置后,将输出保存为指定的文件路径。
设置后,将所有输出打印到 stdout 而不是相应的文件。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
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}
必需参数
用于从文件系统中生成参数文件的 Bicep 文件的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
设置 include 参数。 有效值为 (全部 |RequiredOnly 。
设置时,在不还原外部模块的情况下生成参数文件。
设置后,将输出保存在指定的目录中。
设置后,将输出保存为指定的文件路径。
设置输出格式。 有效值为 (json | bicepparam )。
设置后,将所有输出打印到 stdout 而不是相应的文件。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep install
安装 Bicep CLI。
az bicep install [--target-platform {linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-arm64, 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
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Bicep CLI 将运行的平台。 将其设置为跳过自动平台检测(如果它无法正常工作)。
| 属性 | 值 |
|---|---|
| 接受的值: | linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-arm64, win-x64 |
要安装的 Bicep CLI 版本。 如果未指定,则默认为最新。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
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}
必需参数
要在文件系统中 lint 的 Bicep 模块文件的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
设置诊断格式。
| 属性 | 值 |
|---|---|
| 接受的值: | default, sarif |
设置时,在不还原外部模块的情况下生成参数文件。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep list-versions
列出 Bicep CLI 的所有可用版本。
az bicep list-versions
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep publish
将 bicep 文件发布到远程模块注册表。
az bicep publish --file
--target
[--documentation-uri]
[--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}" --documentation-uri {documentation_uri}
使用文档 URI 发布 bicep 文件并包括源代码
az bicep publish --file {bicep_file} --target "br:{registry}/{module_path}:{tag}" --documentation-uri {documentation_uri} --with-source
必需参数
要在文件系统中发布的 Bicep 模块文件的路径。
将发布 Bicep 模块的目标位置。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Bicep 模块的文档 URI。
选项“--documentationuri”已弃用,将在将来的版本中删除。 请改用“--documentation-uri”。
Bicep 模块的文档 URI。
允许覆盖现有 Bicep 模块版本。
使用模块发布源代码。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep restore
还原 bicep 文件的外部模块。
az bicep restore --file
[--force]
示例
还原外部模块。
az bicep restore --file {bicep_file}
还原外部模块并覆盖缓存的外部模块。
az bicep restore --file {bicep_file} --force
必需参数
要为其还原外部模块的 Bicep 文件的路径。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
允许覆盖缓存的外部模块。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep uninstall
卸载 Bicep CLI。
az bicep uninstall
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep upgrade
将 Bicep CLI 升级到最新版本。
az bicep upgrade [--target-platform {linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-arm64, win-x64}]
示例
升级 Bicep CLI。
az bicep upgrade
升级 Bicep CLI 并指定目标平台。
az bicep upgrade --target-platform linux-x64
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Bicep CLI 将运行的平台。 将其设置为跳过自动平台检测(如果它无法正常工作)。
| 属性 | 值 |
|---|---|
| 接受的值: | linux-arm64, linux-musl-x64, linux-x64, osx-arm64, osx-x64, win-arm64, win-x64 |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az bicep version
显示已安装的 Bicep CLI 版本。
az bicep version
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |