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

az containerapp revision

Note

此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 Learn more about extensions.

用于管理修订的命令。

命令

名称 说明 类型 Status
az containerapp revision activate

激活修订。

Core GA
az containerapp revision copy

基于以前的修订创建修订。

Core GA
az containerapp revision deactivate

停用修订。

Core GA
az containerapp revision label

管理分配给流量权重的修订标签。

核心和扩展 GA
az containerapp revision label add

将修订标签设置为具有关联流量权重的修订。

Core GA
az containerapp revision label add (containerapp 扩展)

将修订标签设置为具有关联流量权重的修订。

Extension GA
az containerapp revision label remove

从具有关联流量权重的修订中删除修订标签。

Core GA
az containerapp revision label remove (containerapp 扩展)

从具有关联流量权重的修订中删除修订标签。

Extension GA
az containerapp revision label swap

在具有关联流量权重的两个修订之间交换修订标签。

Core GA
az containerapp revision list

列出容器应用的修订。

Core GA
az containerapp revision restart

重启修订。

Core GA
az containerapp revision set-mode

设置容器应用的修订模式。

Core GA
az containerapp revision set-mode (containerapp 扩展)

设置容器应用的修订模式。

Extension GA
az containerapp revision show

显示修订的详细信息。

Core GA

az containerapp revision activate

激活修订。

az containerapp revision activate --revision
                                  [--ids]
                                  [--name]
                                  [--resource-group]
                                  [--subscription]

示例

激活修订。

az containerapp revision activate -g MyResourceGroup --revision MyContainerappRevision

必需参数

--revision

修订的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

属性
Parameter group: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

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

属性
Parameter group: Resource Id Arguments
全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--verbose

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

属性
默认值: False

az containerapp revision copy

基于以前的修订创建修订。

az containerapp revision copy [--args]
                              [--command]
                              [--container-name]
                              [--cpu]
                              [--from-revision]
                              [--ids]
                              [--image]
                              [--max-replicas]
                              [--memory]
                              [--min-replicas]
                              [--name]
                              [--remove-all-env-vars]
                              [--remove-env-vars]
                              [--replace-env-vars]
                              [--resource-group]
                              [--revision-suffix]
                              [--scale-rule-auth --sra]
                              [--scale-rule-http-concurrency --scale-rule-tcp-concurrency --srhc --srtc]
                              [--scale-rule-metadata --srm]
                              [--scale-rule-name --srn]
                              [--scale-rule-type --srt]
                              [--set-env-vars]
                              [--subscription]
                              [--tags]
                              [--workload-profile-name]
                              [--yaml]

示例

基于以前的修订创建修订。

az containerapp revision copy -n my-containerapp -g MyResourceGroup --cpu 0.75 --memory 1.5Gi

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--args

容器启动命令参数的列表。 空格分隔的值,例如“-c”“mycommand”。 用于清除现有值的空字符串。

属性
Parameter group: Container Arguments
--command

将在启动期间执行的容器上支持的命令列表。 空格分隔的值,例如“/bin/queue”“mycommand”。 用于清除现有值的空字符串。

属性
Parameter group: Container Arguments
--container-name

容器的名称。

属性
Parameter group: Container Arguments
--cpu

核心中所需的 CPU(从 0.25 到 2.0),例如 0.5。

属性
Parameter group: Container Arguments
--from-revision

要从中复制的修订。 默认值:最新修订。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--image -i

容器映像,例如 publisher/image-name:tag。

--max-replicas

最大副本数。

属性
Parameter group: Scale Arguments
--memory

0.5 - 4.0 的必需内存以“Gi”结尾,例如 1.0Gi。

属性
Parameter group: Container Arguments
--min-replicas

副本的最小数目。

属性
Parameter group: Scale Arguments
--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

属性
Parameter group: Resource Id Arguments
--remove-all-env-vars

从 container 中删除所有环境变量。。

属性
Parameter group: Environment variables Arguments
默认值: False
--remove-env-vars

从容器中删除环境变量。 空格分隔的环境变量名称。

属性
Parameter group: Environment variables Arguments
--replace-env-vars

替换容器中的环境变量。 将删除其他现有环境变量。 以“key=value”格式分隔的空间值。 如果存储为机密,则值必须以“secretref:”开头,后跟机密名称。

属性
Parameter group: Environment variables Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--revision-suffix

追加到修订名称的用户友好后缀。

属性
Parameter group: Container Arguments
--scale-rule-auth --sra

缩放规则身份验证参数。 身份验证参数的格式必须为“{triggerParameter}={secretRef} {triggerParameter}={secretRef} ...”。

属性
Parameter group: Scale Arguments
--scale-rule-http-concurrency --scale-rule-tcp-concurrency --srhc --srtc

横向扩展前的最大并发请求数。仅支持 http 和 tcp 缩放规则。

属性
Parameter group: Scale Arguments
--scale-rule-metadata --srm

缩放规则元数据。 元数据的格式必须为“{key}={value} {key}={value} ...”。

属性
Parameter group: Scale Arguments
--scale-rule-name --srn

缩放规则的名称。

属性
Parameter group: Scale Arguments
--scale-rule-type --srt

缩放规则的类型。 Default: http. 有关详细信息,请访问 https://learn.microsoft.com/azure/container-apps/scale-app#scale-triggers

属性
Parameter group: Scale Arguments
--set-env-vars

在容器中添加或更新环境变量。 不会修改现有环境变量。 以“key=value”格式分隔的空间值。 如果存储为机密,则值必须以“secretref:”开头,后跟机密名称。

属性
Parameter group: Environment variables Arguments
--subscription

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

属性
Parameter group: Resource Id Arguments
--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。

--workload-profile-name -w

工作负荷配置文件的友好名称。

--yaml

具有容器应用的配置的 .yaml 文件的路径。 将忽略所有其他参数。 有关示例,请参阅 https://learn.microsoft.com/azure/container-apps/azure-resource-manager-api-spec#examples

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--verbose

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

属性
默认值: False

az containerapp revision deactivate

停用修订。

az containerapp revision deactivate --revision
                                    [--ids]
                                    [--name]
                                    [--resource-group]
                                    [--subscription]

示例

停用修订。

az containerapp revision deactivate -g MyResourceGroup --revision MyContainerappRevision

必需参数

--revision

修订的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

属性
Parameter group: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

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

属性
Parameter group: Resource Id Arguments
全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--verbose

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

属性
默认值: False

az containerapp revision list

列出容器应用的修订。

az containerapp revision list --name
                              --resource-group
                              [--all]

示例

列出容器应用的修订。

az containerapp revision list -n my-containerapp -g MyResourceGroup

必需参数

--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--all

显示非活动修订。

属性
默认值: False
全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--subscription

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

--verbose

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

属性
默认值: False

az containerapp revision restart

重启修订。

az containerapp revision restart --revision
                                 [--ids]
                                 [--name]
                                 [--resource-group]
                                 [--subscription]

示例

重启修订。

az containerapp revision restart -n my-containerapp -g MyResourceGroup --revision MyContainerappRevision

必需参数

--revision

修订的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

属性
Parameter group: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

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

属性
Parameter group: Resource Id Arguments
全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--verbose

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

属性
默认值: False

az containerapp revision set-mode

设置容器应用的修订模式。

az containerapp revision set-mode --mode {multiple, single}
                                  [--ids]
                                  [--name]
                                  [--resource-group]
                                  [--subscription]

示例

将容器应用设置为单一修订模式。

az containerapp revision set-mode -n my-containerapp -g MyResourceGroup --mode Single

必需参数

--mode

容器应用的活动修订模式。

属性
接受的值: multiple, single

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

属性
Parameter group: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

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

属性
Parameter group: Resource Id Arguments
全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--verbose

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

属性
默认值: False

az containerapp revision set-mode (containerapp 扩展)

设置容器应用的修订模式。

az containerapp revision set-mode --mode {labels, multiple, single}
                                  [--ids]
                                  [--name]
                                  [--resource-group]
                                  [--subscription]
                                  [--target-label]

示例

将容器应用设置为单一修订模式。

az containerapp revision set-mode -n my-containerapp -g MyResourceGroup --mode Single

必需参数

--mode

容器应用的活动修订模式。

属性
接受的值: labels, multiple, single

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

属性
Parameter group: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

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

属性
Parameter group: Resource Id Arguments
--target-label
预览

要应用于新修订的标签。 修订模式“标签”是必需的。

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--verbose

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

属性
默认值: False

az containerapp revision show

显示修订的详细信息。

az containerapp revision show --revision
                              [--ids]
                              [--name]
                              [--resource-group]
                              [--subscription]

示例

显示修订的详细信息。

az containerapp revision show -n my-containerapp -g MyResourceGroup \
    --revision MyContainerappRevision

必需参数

--revision

修订的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name -n

Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。

属性
Parameter group: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

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

属性
Parameter group: Resource Id Arguments
全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

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

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

--verbose

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

属性
默认值: False