az containerapp sessionpool
Note
此参考是 Azure CLI(版本 2.62.0 或更高版本)的 容器应用 扩展的一部分。 该扩展将在首次运行 az containerapp sessionpool 命令时自动安装。 了解更多关于扩展的信息。
用于管理会话池的命令。
命令
| 名称 | 说明 | 类型 | Status | 
|---|---|---|---|
| az containerapp sessionpool create | 创建或更新会话池。 | Extension | GA | 
| az containerapp sessionpool delete | 删除会话池。 | Extension | GA | 
| az containerapp sessionpool list | 按订阅或资源组列出会话池。 | Extension | GA | 
| az containerapp sessionpool show | 显示会话池的详细信息。 | Extension | GA | 
| az containerapp sessionpool update | 更新会话池。 | Extension | GA | 
az containerapp sessionpool create
创建或更新会话池。
az containerapp sessionpool create --name
                                   --resource-group
                                   [--args]
                                   [--command]
                                   [--container-name]
                                   [--container-type {CustomContainer, NodeLTS, PythonLTS}]
                                   [--cooldown-period]
                                   [--cpu]
                                   [--env-vars]
                                   [--environment]
                                   [--image]
                                   [--lifecycle-type {OnContainerExit, Timed}]
                                   [--location]
                                   [--max-alive-period]
                                   [--max-sessions]
                                   [--memory]
                                   [--mi-system-assigned]
                                   [--mi-user-assigned]
                                   [--network-status {EgressDisabled, EgressEnabled}]
                                   [--no-wait]
                                   [--probe-yaml]
                                   [--ready-sessions]
                                   [--registry-identity]
                                   [--registry-password]
                                   [--registry-server]
                                   [--registry-username]
                                   [--secrets]
                                   [--target-port]示例
使用容器类型 PythonLTS 默认设置创建或更新会话池。
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --location eastasia使用容器类型 PythonLTS 创建或更新会话池,最大并发会话数为 30,就绪会话实例 20。
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type PythonLTS --max-sessions 30 --ready-sessions 20 \
    --location eastasia使用默认快速入门映像创建或更新容器类型 CustomContainer 的会话池。
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment \
    --cpu 0.5 --memory 1Gi --target-port 80 --location eastasia --image mcr.microsoft.com/k8se/quickstart:latest使用具有机密和环境变量的容器类型 CustomContainer 创建或更新会话池。
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment \
    --cpu 0.5 --memory 1Gi --target-port 80 --image MyImage \
    --env-vars GREETING="Hello, world" SECRETENV=secretref:anothersecret \
    --secrets mysecret=secretvalue1 anothersecret="secret value 2" --location eastasia使用从专用注册表创建的容器类型 CustomContainer 创建或更新会话池
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment --image MyImage \
    --cpu 0.5 --memory 1Gi --target-port 80 --registry-server myregistry.azurecr.io \
    --registry-username myregistry --registry-password $REGISTRY_PASSWORD \
    --location eastasia使用容器类型 CustomContainer 和托管标识创建或更新会话池,以对 Azure 容器注册表进行身份验证
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment --image MyImage \
    --cpu 0.5 --memory 1Gi --target-port 80 --registry-server myregistry.azurecr.io \
    --registry-identity  MyUserIdentityResourceId \
    --location eastasia使用容器类型 CustomContainer 创建或更新会话池,其中包含系统分配的标识和用户分配的标识。
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment --image MyImage \
    --cpu 0.5 --memory 1Gi --target-port 80 \
    --mi-system-assigned --mi-user-assigned MyUserIdentityResourceId \
    --location eastasia使用容器类型 CustomContainer 创建或更新会话池,其冷却期为 360s
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --environment MyEnvironment --cpu 0.5 --memory 1Gi --target-port 80 --container-type CustomContainer \
    --cooldown-period 360 --location eastasia使用容器探测创建或更新容器类型 CustomContainer 的会话池
az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --environment MyEnvironment --cpu 0.5 --memory 1Gi --target-port 80 --container-type CustomContainer \
    --probe-yaml config.yaml --location eastasia必需参数
会话池名称。
资源组的名称。 可以使用 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.
容器启动命令参数的列表。 空格分隔的值,例如“-c”“mycommand”。 用于清除现有值的空字符串。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
将在启动期间执行的容器上支持的命令列表。 空格分隔的值,例如“/bin/queue”“mycommand”。 用于清除现有值的空字符串。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
容器的名称。 如果未提供容器名称,则创建时,容器名称将默认为覆盖为小写的会话池的名称。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
会话池的池类型,默认值为“PythonLTS”。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
| 接受的值: | CustomContainer, NodeLTS, PythonLTS | 
句点(以秒为单位),之后将删除会话,这仅适用于生命周期类型“Timed”,default=300。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
核心中所需的 CPU(从 0.25 到 2.0),例如 0.5。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
容器的环境变量列表。 以“key=value”格式分隔的空间值。 用于清除现有值的空字符串。 前缀值为“secretref:”以引用机密。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
容器应用环境的名称或资源 ID。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
容器映像,例如 publisher/image-name:tag。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
会话池的生命周期类型。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
| 默认值: | Timed | 
| 接受的值: | OnContainerExit, Timed | 
Location. 
              az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。
如果会话容器之前未退出会话(以秒为单位),则此句点(以秒为单位),这仅适用于生命周期类型“OnContainerExit”,default=3600。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
可以同时运行最大会话计数。
| 属性 | 值 | 
|---|---|
| Parameter group: | Scale Arguments | 
0.5 - 4.0 的必需内存以“Gi”结尾,例如 1.0Gi。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
指示是否分配系统分配标识的布尔值。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
要分配的空间分隔用户标识。
已为会话启用出口。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
| 接受的值: | EgressDisabled, EgressEnabled | 
不等待长时间运行的操作完成。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
具有容器探测配置的 .yaml 文件的路径。 仅适用于自定义容器会话池。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
在会话池中随时准备就绪的会话数。
| 属性 | 值 | 
|---|---|
| Parameter group: | Scale Arguments | 
要向Azure 容器注册表(而不是用户名/密码)进行身份验证的托管标识。 对系统分配的标识使用“system”,对用户分配的标识使用资源 ID。 在部署之前,应为托管标识分配 ACR 的 acrpull 权限(使用“az role assignment create --role acrpull ...”)。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
登录到容器注册表的密码。 如果存储为机密,则值必须以“secretref:”开头,后跟机密名称。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
容器注册表服务器主机名,例如 myregistry.azurecr.io。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
要登录到容器注册表的用户名。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
会话池的机密列表。 以“key=value”格式分隔的空间值。 用于清除现有值的空字符串。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
用于入口流量的会话端口。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | 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 containerapp sessionpool delete
删除会话池。
az containerapp sessionpool delete --resource-group
                                   [--ids]
                                   [--name]
                                   [--no-wait]
                                   [--subscription]
                                   [--yes]示例
删除会话池。
az containerapp sessionpool delete -n mysessionpool -g MyResourceGroup必需参数
资源组的名称。 可以使用 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.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
会话池名称。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
不等待长时间运行的操作完成。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
不要提示确认。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
输出格式。
| 属性 | 值 | 
|---|---|
| 默认值: | json | 
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc | 
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
az containerapp sessionpool list
按订阅或资源组列出会话池。
az containerapp sessionpool list [--resource-group]示例
列出当前订阅中的会话池。
az containerapp sessionpool list按资源组列出会话池。
az containerapp sessionpool list -g MyResourceGroup可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | 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 containerapp sessionpool show
显示会话池的详细信息。
az containerapp sessionpool show --resource-group
                                 [--ids]
                                 [--name]
                                 [--subscription]示例
显示会话池的详细信息。
az containerapp sessionpool show -n mysessionpool -g MyResourceGroup必需参数
资源组的名称。 可以使用 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.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
会话池名称。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
输出格式。
| 属性 | 值 | 
|---|---|
| 默认值: | json | 
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc | 
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
az containerapp sessionpool update
更新会话池。
az containerapp sessionpool update --resource-group
                                   [--args]
                                   [--command]
                                   [--container-name]
                                   [--cooldown-period]
                                   [--cpu]
                                   [--env-vars]
                                   [--ids]
                                   [--image]
                                   [--lifecycle-type {OnContainerExit, Timed}]
                                   [--location]
                                   [--max-alive-period]
                                   [--max-sessions]
                                   [--memory]
                                   [--mi-system-assigned]
                                   [--mi-user-assigned]
                                   [--name]
                                   [--network-status {EgressDisabled, EgressEnabled}]
                                   [--no-wait]
                                   [--probe-yaml]
                                   [--ready-sessions]
                                   [--registry-identity]
                                   [--registry-password]
                                   [--registry-server]
                                   [--registry-username]
                                   [--secrets]
                                   [--subscription]
                                   [--target-port]示例
更新会话池的最大并发会话配置和映像。
az containerapp sessionpool update -n mysessionpool -g MyResourceGroup --max-sessions 20 --image MyNewImage更新 CustomContainer 类型会话池的容器探测。
az containerapp sessionpool update -n mysessionpool -g MyResourceGroup --probe-yaml config.yaml必需参数
资源组的名称。 可以使用 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.
容器启动命令参数的列表。 空格分隔的值,例如“-c”“mycommand”。 用于清除现有值的空字符串。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
将在启动期间执行的容器上支持的命令列表。 空格分隔的值,例如“/bin/queue”“mycommand”。 用于清除现有值的空字符串。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
容器的名称。 如果未提供容器名称,则创建时,容器名称将默认为覆盖为小写的会话池的名称。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
句点(以秒为单位),之后将删除会话,这仅适用于生命周期类型“Timed”,default=300。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
核心中所需的 CPU(从 0.25 到 2.0),例如 0.5。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
容器的环境变量列表。 以“key=value”格式分隔的空间值。 用于清除现有值的空字符串。 前缀值为“secretref:”以引用机密。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
容器映像,例如 publisher/image-name:tag。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
会话池的生命周期类型。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
| 接受的值: | OnContainerExit, Timed | 
Location. 
              az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。
如果会话容器之前未退出会话(以秒为单位),则此句点(以秒为单位),这仅适用于生命周期类型“OnContainerExit”,default=3600。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
可以同时运行最大会话计数。
| 属性 | 值 | 
|---|---|
| Parameter group: | Scale Arguments | 
0.5 - 4.0 的必需内存以“Gi”结尾,例如 1.0Gi。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
指示是否分配系统分配标识的布尔值。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
要分配的空间分隔用户标识。
会话池名称。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
已为会话启用出口。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
| 接受的值: | EgressDisabled, EgressEnabled | 
不等待长时间运行的操作完成。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
具有容器探测配置的 .yaml 文件的路径。 仅适用于自定义容器会话池。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
在会话池中随时准备就绪的会话数。
| 属性 | 值 | 
|---|---|
| Parameter group: | Scale Arguments | 
要向Azure 容器注册表(而不是用户名/密码)进行身份验证的托管标识。 对系统分配的标识使用“system”,对用户分配的标识使用资源 ID。 在部署之前,应为托管标识分配 ACR 的 acrpull 权限(使用“az role assignment create --role acrpull ...”)。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
登录到容器注册表的密码。 如果存储为机密,则值必须以“secretref:”开头,后跟机密名称。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
容器注册表服务器主机名,例如 myregistry.azurecr.io。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
要登录到容器注册表的用户名。
| 属性 | 值 | 
|---|---|
| Parameter group: | Registry Arguments | 
会话池的机密列表。 以“key=value”格式分隔的空间值。 用于清除现有值的空字符串。
| 属性 | 值 | 
|---|---|
| Parameter group: | Configuration Arguments | 
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 | 
|---|---|
| Parameter group: | Resource Id Arguments | 
用于入口流量的会话端口。
| 属性 | 值 | 
|---|---|
| Parameter group: | Container Arguments | 
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 | 
|---|---|
| 默认值: | False | 
输出格式。
| 属性 | 值 | 
|---|---|
| 默认值: | json | 
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc | 
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 | 
|---|---|
| 默认值: | False |