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

az container container-group-profile

管理 Azure 容器实例容器组配置文件。

命令

名称 说明 类型 Status
az container container-group-profile create

创建容器组配置文件。

核心 GA
az container container-group-profile delete

删除容器组配置文件。

核心 GA
az container container-group-profile list

列出资源组中的所有容器组配置文件。

核心 GA
az container container-group-profile list-revisions

列出容器组配置文件的所有修订。

核心 GA
az container container-group-profile show

获取容器组配置文件。

核心 GA
az container container-group-profile show-revision

显示容器组配置文件修订。

核心 GA

az container container-group-profile create

创建容器组配置文件。

az container container-group-profile create --resource-group
                                            [--acr-identity]
                                            [--add-capabilities]
                                            [--allow-escalation]
                                            [--azure-file-volume-account-key]
                                            [--azure-file-volume-account-name]
                                            [--azure-file-volume-mount-path]
                                            [--azure-file-volume-share-name]
                                            [--cce-policy]
                                            [--command-line]
                                            [--config-map]
                                            [--cpu]
                                            [--drop-capabilities]
                                            [--environment-variables]
                                            [--file]
                                            [--gitrepo-dir]
                                            [--gitrepo-mount-path]
                                            [--gitrepo-revision]
                                            [--gitrepo-url]
                                            [--image]
                                            [--ip-address {Private, Public}]
                                            [--___location]
                                            [--log-analytics-workspace]
                                            [--log-analytics-workspace-key]
                                            [--memory]
                                            [--name]
                                            [--no-wait]
                                            [--os-type {Linux, Windows}]
                                            [--ports]
                                            [--priority]
                                            [--privileged]
                                            [--protocol {TCP, UDP}]
                                            [--registry-login-server]
                                            [--registry-password]
                                            [--registry-username]
                                            [--restart-policy {Always, Never, OnFailure}]
                                            [--run-as-group]
                                            [--run-as-user]
                                            [--seccomp-profile]
                                            [--secrets]
                                            [--secrets-mount-path]
                                            [--secure-environment-variables]
                                            [--sku]
                                            [--zone]

示例

创建容器组配置文件。

az container container-group-profile create --resource-group MyResourceGroup --name myapp --image myimage:latest --cpu 1 --memory 1

必需参数

--resource-group -g

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

可选参数

--acr-identity

有权访问容器注册表的标识。

--add-capabilities

要添加的安全上下文功能的列表。

--allow-escalation

允许进程能否获得比其父进程更多的特权。

默认值: False
--azure-file-volume-account-key

用于访问 Azure 文件共享的存储帐户访问密钥。

--azure-file-volume-account-name

包含 Azure 文件共享的存储帐户的名称。

--azure-file-volume-mount-path

应装载 Azure 文件卷的容器中的路径。 不得包含冒号“:”。

--azure-file-volume-share-name

要装载为卷的 Azure 文件共享的名称。

--cce-policy

机密容器组的 CCE 策略。

--command-line

启动容器时要运行的命令行,例如“/bin/bash -c myscript.sh”。

--config-map

容器的配置映射键值对列表。 以“key=value”格式分隔的空间值。

--cpu

容器的所需 CPU 核心数,准确到一个小数位数。

默认值: 1
--drop-capabilities

要删除的安全上下文功能的列表。

--environment-variables -e

容器的环境变量列表。 以“key=value”格式分隔的空间值。

--file -f

输入文件的路径。

--gitrepo-dir

git 存储库中的目标目录路径。 不得包含“..”。

默认值: .
--gitrepo-mount-path

应装载 git 存储库卷的容器中的路径。 不得包含冒号“:”。

--gitrepo-revision

指定修订的提交哈希。

--gitrepo-url

要装载为卷的 git 存储库的 URL。

--image

容器映像名称。

--ip-address

容器组的 IP 地址类型。

接受的值: Private, Public
--___location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults ___location=<___location> 配置默认位置。

--log-analytics-workspace

Log Analytics 工作区名称或 ID。使用当前订阅或使用 --subscription 标志设置所需的订阅。

--log-analytics-workspace-key

Log Analytics 工作区密钥。

--memory

容器的所需内存(以 GB 为单位,精确到一个小数位)。

默认值: 1.5
--name -n

容器组的名称。

--no-wait

不等待长时间运行的操作完成。

默认值: False
--os-type

容器的 OS 类型。

接受的值: Linux, Windows
默认值: Linux
--ports

要打开的端口列表。 以空格分隔的端口列表。

默认值: [80]
--priority

容器组的优先级。

--privileged

用于确定容器权限是否提升为 Privileged 的标志。

默认值: False
--protocol

要使用的网络协议。

接受的值: TCP, UDP
--registry-login-server

容器映像注册表登录服务器。

--registry-password

用于登录容器映像注册表服务器的密码。

--registry-username

要在容器映像注册表服务器中登录的用户名。

--restart-policy

重启容器组中所有容器的策略。

接受的值: Always, Never, OnFailure
--run-as-group

设置容器的用户 UID。

--run-as-user

设置容器的用户 GID。

--seccomp-profile

包含 seccomp 配置文件中 JSON 内容的 base64 编码字符串。

--secrets

以“key=value”格式分隔的空间分隔机密。

--secrets-mount-path

应装载机密卷的容器中的路径。 不得包含冒号“:”。

--secure-environment-variables

容器的安全环境变量列表。 以“key=value”格式分隔的空间值。

--sku

容器组的 SKU。

--zone

要放置容器组的区域。

全局参数
--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 container container-group-profile delete

删除容器组配置文件。

az container container-group-profile delete [--ids]
                                            [--name]
                                            [--resource-group]
                                            [--subscription]
                                            [--yes]

示例

删除容器组配置文件。

az container container-group-profile delete --resource-group MyResourceGroup --name mycgprofile

可选参数

--ids

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

--name -n

容器组的名称。

--resource-group -g

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

--subscription

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

--yes -y

不要提示确认。

默认值: False
全局参数
--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 container container-group-profile list

列出资源组中的所有容器组配置文件。

az container container-group-profile list [--resource-group]

可选参数

--resource-group -g

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

全局参数
--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 container container-group-profile list-revisions

列出容器组配置文件的所有修订。

az container container-group-profile list-revisions [--ids]
                                                    [--name]
                                                    [--resource-group]
                                                    [--subscription]

可选参数

--ids

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

--name -n

容器组的名称。

--resource-group -g

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

--subscription

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

全局参数
--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 container container-group-profile show

获取容器组配置文件。

az container container-group-profile show [--ids]
                                          [--name]
                                          [--resource-group]
                                          [--subscription]

示例

获取容器组配置文件。

az container container-group-profile show --resource-group MyResourceGroup --name mycgprofile

可选参数

--ids

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

--name -n

容器组的名称。

--resource-group -g

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

--subscription

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

全局参数
--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 container container-group-profile show-revision

显示容器组配置文件修订。

az container container-group-profile show-revision 
                                                   [--ids]
                                                   [--name]
                                                   [--resource-group]
                                                   [--subscription]

示例

显示容器组配置文件。

az container container-group-profile show-revision --resource-group MyResourceGroup --name mycgprofile -r 1

必需参数

-r

容器组配置文件的修订。

可选参数

--ids

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

--name -n

容器组的名称。

--resource-group -g

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

--subscription

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

全局参数
--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 获取完整的调试日志。