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

CG Profile - Get

显示有关指定 ContainerGroupProfile 的信息。
获取指定容器组配置文件的属性。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}?api-version=2025-09-01

URI 参数

名称 必需 类型 说明
containerGroupProfileName
path True

string

minLength: 1
maxLength: 63
pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$

ContainerGroupProfile 名称。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

响应

名称 类型 说明
200 OK

ContainerGroupProfile

Azure 运营顺利完成。

Other Status Codes

CloudError

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流程。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

ContainerGroupProfilesGet_Succeeded
ContainerGroupProfilesGetWithPriority

ContainerGroupProfilesGet_Succeeded

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroupProfiles/demo1?api-version=2025-09-01

示例响应

{
  "name": "demo1",
  "type": "Microsoft.ContainerInstance/containerGroupProfiles",
  "id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroupProfiles/demo1",
  "location": "WestUs",
  "properties": {
    "containers": [
      {
        "name": "demo1",
        "properties": {
          "command": [],
          "environmentVariables": [],
          "image": "nginx",
          "ports": [
            {
              "port": 80
            }
          ],
          "resources": {
            "requests": {
              "cpu": 1,
              "memoryInGB": 1.5
            }
          },
          "volumeMounts": [
            {
              "name": "volume1",
              "mountPath": "/mnt/volume1",
              "readOnly": false
            }
          ]
        }
      }
    ],
    "imageRegistryCredentials": [
      {
        "server": "azcloudconsoleregistry.azurecr.io",
        "username": "azcloudconsoleregistry"
      }
    ],
    "ipAddress": {
      "type": "Public",
      "ip": "10.0.0.1",
      "ports": [
        {
          "port": 80,
          "protocol": "TCP"
        }
      ]
    },
    "osType": "Linux",
    "revision": 1,
    "sku": "Standard",
    "volumes": [
      {
        "name": "volume1",
        "azureFile": {
          "readOnly": false,
          "shareName": "share1",
          "storageAccountName": "storage1"
        }
      }
    ]
  },
  "zones": [
    "1"
  ]
}

ContainerGroupProfilesGetWithPriority

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroupProfiles/demo1?api-version=2025-09-01

示例响应

{
  "name": "demo1",
  "type": "Microsoft.ContainerInstance/containerGroupProfiles",
  "id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroupProfiles/demo1",
  "location": "WestUs",
  "properties": {
    "containers": [
      {
        "name": "demo1",
        "properties": {
          "command": [],
          "environmentVariables": [],
          "image": "nginx",
          "ports": [
            {
              "port": 80
            }
          ],
          "resources": {
            "requests": {
              "cpu": 1,
              "memoryInGB": 1.5
            }
          },
          "volumeMounts": [
            {
              "name": "volume1",
              "mountPath": "/mnt/volume1",
              "readOnly": false
            }
          ]
        }
      }
    ],
    "imageRegistryCredentials": [
      {
        "server": "azcloudconsoleregistry.azurecr.io",
        "username": "azcloudconsoleregistry"
      }
    ],
    "ipAddress": {
      "type": "Public",
      "ip": "10.0.0.1",
      "ports": [
        {
          "port": 80,
          "protocol": "TCP"
        }
      ]
    },
    "osType": "Linux",
    "priority": "Spot",
    "revision": 1,
    "sku": "Standard",
    "volumes": [
      {
        "name": "volume1",
        "azureFile": {
          "readOnly": false,
          "shareName": "share1",
          "storageAccountName": "storage1"
        }
      }
    ]
  },
  "zones": [
    "1"
  ]
}

定义

名称 说明
AzureFileVolume

Azure 文件卷的属性。 Azure 文件共享装载为卷。

CloudError

容器实例服务的错误响应。

CloudErrorBody

容器实例服务的错误响应。

ConfidentialComputeProperties

机密容器组的属性

ConfigMap

容器配置映射。

Container

容器实例。

ContainerExec

容器执行命令,用于实时或就绪情况探测

ContainerGroupDiagnostics

容器组诊断信息。

ContainerGroupIpAddressType

指定 IP 是否向公共 Internet 或专用 VNET 公开。

ContainerGroupNetworkProtocol

与端口关联的协议。

ContainerGroupPriority

容器组的优先级。

ContainerGroupProfile

容器组配置文件对象

ContainerGroupRestartPolicy

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

  • Always 始终重启
  • 失败时 OnFailure 重启
  • Never 从不重启
ContainerGroupSku

容器组 SKU。

ContainerHttpGet

容器 Http Get 设置,用于实时或就绪情况探测

ContainerNetworkProtocol

与端口关联的协议。

ContainerPort

在容器实例上公开的端口。

ContainerProbe

容器探测,用于生存或就绪情况

ContainerPropertiesInstanceView

容器实例的实例视图。 仅在响应中有效。

ContainerState

容器实例状态。

createdByType

创建资源的标识的类型。

DeploymentExtensionSpec

要添加到部署中的扩展 sidecar。

DnsNameLabelReusePolicy

表示安全枚举的值。 如果未选择“不安全”值,则为默认值,表示对象域名标签不受子域接管保护。 如果选中“TenantReuse”值,则为默认值,表示可以在同一租户中重复使用对象的域名标签。 “SubscriptionReuse”值表示可以在同一订阅中重复使用对象的域名标签。 “ResourceGroupReuse”值表示可以在同一资源组中重复使用对象的域名标签。 “NoReuse”值表示不能在同一资源组、订阅或租户中重复使用对象的域名标签。

EncryptionProperties

容器组加密属性。

EnvironmentVariable

在容器实例中设置的环境变量。

Event

容器组或容器实例事件。

GitRepoVolume

表示使用 git 存储库的内容填充的卷

GpuResource

GPU 资源。

GpuSku

GPU 资源的 SKU。

HttpHeader

HTTP 标头。

ImageRegistryCredential

映像注册表凭据。

InitContainerDefinition

init 容器定义。

InitContainerPropertiesDefinitionInstanceView

init 容器的实例视图。 仅在响应中有效。

IpAddress

容器组的 IP 地址。

LogAnalytics

容器组日志分析信息。

LogAnalyticsLogType

要使用的日志类型。

OperatingSystemTypes

容器组中容器所需的操作系统类型。

Port

容器组上公开的端口。

ResourceLimits

资源限制。

ResourceRequests

资源请求。

ResourceRequirements

资源要求。

Scheme

方案。

SecurityContextCapabilitiesDefinition

从容器添加或删除的功能。

SecurityContextDefinition

容器的安全上下文。

systemData

与创建和上次修改资源相关的元数据。

Volume

卷的属性。

VolumeMount

卷装载的属性。

AzureFileVolume

Azure 文件卷的属性。 Azure 文件共享装载为卷。

名称 类型 说明
readOnly

boolean

指示装载为卷的 Azure 文件共享是否为只读的标志。

shareName

string

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

storageAccountKey

string (password)

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

storageAccountKeyReference

string

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

storageAccountName

string

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

CloudError

容器实例服务的错误响应。

名称 类型 说明
error

CloudErrorBody

容器实例服务的错误响应。

CloudErrorBody

容器实例服务的错误响应。

名称 类型 说明
code

string

错误的标识符。 代码是固定的,旨在以编程方式使用。

details

CloudErrorBody[]

有关错误的其他详细信息的列表。

message

string

描述错误的消息,旨在适合在用户界面中显示。

target

string

特定错误的目标。 例如,错误属性的名称。

ConfidentialComputeProperties

机密容器组的属性

名称 类型 说明
ccePolicy

string

base64 编码的机密计算强制策略

ConfigMap

容器配置映射。

名称 类型 说明
keyValuePairs

object

配置映射中的键值对字典。

Container

容器实例。

名称 类型 说明
name

string

容器实例的用户提供的名称。

properties.command

string[]

要以 exec 形式在容器实例中执行的命令。

properties.configMap

ConfigMap

配置映射。

properties.environmentVariables

EnvironmentVariable[]

在容器实例中设置的环境变量。

properties.image

string

用于创建容器实例的映像的名称。

properties.instanceView

ContainerPropertiesInstanceView

容器实例的实例视图。 仅在响应中有效。

properties.livenessProbe

ContainerProbe

生存度探测。

properties.ports

ContainerPort[]

容器实例上公开的端口。

properties.readinessProbe

ContainerProbe

就绪情况探测。

properties.resources

ResourceRequirements

容器实例的资源要求。

properties.securityContext

SecurityContextDefinition

容器安全属性。

properties.volumeMounts

VolumeMount[]

卷装载可用于容器实例。

ContainerExec

容器执行命令,用于实时或就绪情况探测

名称 类型 说明
command

string[]

在容器中执行的命令。

ContainerGroupDiagnostics

容器组诊断信息。

名称 类型 说明
logAnalytics

LogAnalytics

容器组日志分析信息。

ContainerGroupIpAddressType

指定 IP 是否向公共 Internet 或专用 VNET 公开。

说明
Public

公众

Private

私密

ContainerGroupNetworkProtocol

与端口关联的协议。

说明
TCP

TCP

UDP

UDP

ContainerGroupPriority

容器组的优先级。

说明
Regular

常规

Spot

现付

ContainerGroupProfile

容器组配置文件对象

名称 类型 说明
id

string (arm-id)

资源的完全限定资源 ID。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

location

string

资源所在的地理位置

name

string

资源的名称

properties.confidentialComputeProperties

ConfidentialComputeProperties

机密容器组的属性

properties.containers

Container[]

容器组中的容器。

properties.diagnostics

ContainerGroupDiagnostics

容器组的诊断信息。

properties.encryptionProperties

EncryptionProperties

容器组的加密属性。

properties.extensions

DeploymentExtensionSpec[]

虚拟 kubelet 使用的扩展

properties.imageRegistryCredentials

ImageRegistryCredential[]

从中创建容器组的映像注册表凭据。

properties.initContainers

InitContainerDefinition[]

容器组的初始化容器。

properties.ipAddress

IpAddress

容器组的 IP 地址类型。

properties.osType

OperatingSystemTypes

容器组中容器所需的操作系统类型。

properties.priority

ContainerGroupPriority

容器组的优先级。

properties.registeredRevisions

integer[] (int32)

注册的修订是根据表日志中的记录在请求时计算的。

properties.restartPolicy

ContainerGroupRestartPolicy

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

  • Always 始终重启
  • 失败时 OnFailure 重启
  • Never 从不重启
properties.revision

integer (int32)

容器组配置文件当前修订号

properties.securityContext

SecurityContextDefinition

容器安全属性。

properties.shutdownGracePeriod

string (date-time)

容器组中容器的关闭宽限期。

properties.sku

ContainerGroupSku

容器组的 SKU。

properties.timeToLive

string (date-time)

CG 容器的完成后生存时间

properties.useKrypton

boolean

获取或设置 Krypton use 属性。

properties.volumes

Volume[]

此容器组中的容器可以装载的卷列表。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

tags

object

资源标记。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

zones

string[]

可用性区域。

ContainerGroupRestartPolicy

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

  • Always 始终重启
  • 失败时 OnFailure 重启
  • Never 从不重启
说明
Always

始终

OnFailure

OnFailure

Never

从不

ContainerGroupSku

容器组 SKU。

说明
NotSpecified

未指定

Standard

标准

Dedicated

专属

Confidential

机密

ContainerHttpGet

容器 Http Get 设置,用于实时或就绪情况探测

名称 类型 说明
httpHeaders

HttpHeader[]

HTTP 标头。

path

string

探测的路径。

port

integer (int32)

要探测的端口号。

scheme

Scheme

方案。

ContainerNetworkProtocol

与端口关联的协议。

说明
TCP

TCP

UDP

UDP

ContainerPort

在容器实例上公开的端口。

名称 类型 说明
port

integer (int32)

容器组中公开的端口号。

protocol

ContainerNetworkProtocol

与端口关联的协议。

ContainerProbe

容器探测,用于生存或就绪情况

名称 类型 说明
exec

ContainerExec

要探测的执行命令

failureThreshold

integer (int32)

失败阈值。

httpGet

ContainerHttpGet

要探测的 Http 获取设置

initialDelaySeconds

integer (int32)

初始延迟秒。

periodSeconds

integer (int32)

时间段秒。

successThreshold

integer (int32)

成功阈值。

timeoutSeconds

integer (int32)

超时秒。

ContainerPropertiesInstanceView

容器实例的实例视图。 仅在响应中有效。

名称 类型 说明
currentState

ContainerState

当前容器实例状态。

events

Event[]

容器实例的事件。

previousState

ContainerState

以前的容器实例状态。

restartCount

integer (int32)

容器实例已重启的次数。

ContainerState

容器实例状态。

名称 类型 说明
detailStatus

string

容器实例状态的可读状态。

exitCode

integer (int32)

容器实例退出代码对应于 docker run 命令中的代码。

finishTime

string (date-time)

容器实例状态完成的日期/时间。

startTime

string (date-time)

容器实例状态启动的日期/时间。

state

string

容器实例的状态。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

DeploymentExtensionSpec

要添加到部署中的扩展 sidecar。

名称 类型 说明
name

string

扩展的名称。

properties.extensionType

string

要添加的扩展的类型。

properties.protectedSettings

扩展的受保护设置。

properties.settings

扩展的设置。

properties.version

string

正在使用的扩展的版本。

DnsNameLabelReusePolicy

表示安全枚举的值。 如果未选择“不安全”值,则为默认值,表示对象域名标签不受子域接管保护。 如果选中“TenantReuse”值,则为默认值,表示可以在同一租户中重复使用对象的域名标签。 “SubscriptionReuse”值表示可以在同一订阅中重复使用对象的域名标签。 “ResourceGroupReuse”值表示可以在同一资源组中重复使用对象的域名标签。 “NoReuse”值表示不能在同一资源组、订阅或租户中重复使用对象的域名标签。

说明
Unsecure

不安全

TenantReuse

TenantReuse

SubscriptionReuse

SubscriptionReuse

ResourceGroupReuse

ResourceGroupReuse

Noreuse

诺鲁斯

EncryptionProperties

容器组加密属性。

名称 类型 说明
identity

string

keyvault 托管标识。

keyName

string

加密密钥名称。

keyVersion

string

加密密钥版本。

vaultBaseUrl

string

keyvault 基 URL。

EnvironmentVariable

在容器实例中设置的环境变量。

名称 类型 说明
name

string

环境变量的名称。

secureValue

string (password)

安全环境变量的值。

secureValueReference

string

安全环境变量的引用。

value

string

环境变量的值。

Event

容器组或容器实例事件。

名称 类型 说明
count

integer (int32)

事件的计数。

firstTimestamp

string (date-time)

最早记录事件的日期时间。

lastTimestamp

string (date-time)

最新记录事件的日期时间。

message

string

事件消息。

name

string

事件名称。

type

string

事件类型。

GitRepoVolume

表示使用 git 存储库的内容填充的卷

名称 类型 说明
directory

string

目标目录名称。 不得包含或以“..”开头。 如果提供了“.”,卷目录将是 git 存储库。 否则,如果指定,卷将包含具有给定名称的子目录中的 git 存储库。

repository

string

存储库 URL

revision

string

指定修订的提交哈希。

GpuResource

GPU 资源。

名称 类型 说明
count

integer (int32)

GPU 资源的计数。

sku

GpuSku

GPU 资源的 SKU。

GpuSku

GPU 资源的 SKU。

说明
K80

K80

P100

P100

V100

V100

HttpHeader

HTTP 标头。

名称 类型 说明
name

string

标头名称。

value

string

标头值。

ImageRegistryCredential

映像注册表凭据。

名称 类型 说明
identity

string

专用注册表的标识。

identityUrl

string

专用注册表的标识 URL。

password

string (password)

专用注册表的密码。

passwordReference

string

专用注册表密码的引用。

server

string

没有协议(如“http”和“https”)的 Docker 映像注册表服务器。

username

string

专用注册表的用户名。

InitContainerDefinition

init 容器定义。

名称 类型 说明
name

string

init 容器的名称。

properties.command

string[]

要以 exec 形式在 init 容器中执行的命令。

properties.environmentVariables

EnvironmentVariable[]

在 init 容器中设置的环境变量。

properties.image

string

init 容器的图像。

properties.instanceView

InitContainerPropertiesDefinitionInstanceView

init 容器的实例视图。 仅在响应中有效。

properties.securityContext

SecurityContextDefinition

容器安全属性。

properties.volumeMounts

VolumeMount[]

可用于 init 容器的卷装载。

InitContainerPropertiesDefinitionInstanceView

init 容器的实例视图。 仅在响应中有效。

名称 类型 说明
currentState

ContainerState

init 容器的当前状态。

events

Event[]

init 容器的事件。

previousState

ContainerState

init 容器的上一状态。

restartCount

integer (int32)

初始化容器已重启的次数。

IpAddress

容器组的 IP 地址。

名称 类型 默认值 说明
autoGeneratedDomainNameLabelScope

DnsNameLabelReusePolicy

Unsecure

表示安全枚举的值。 如果未选择“不安全”值,则为默认值,表示对象域名标签不受子域接管保护。 如果选中“TenantReuse”值,则为默认值,表示可以在同一租户中重复使用对象的域名标签。 “SubscriptionReuse”值表示可以在同一订阅中重复使用对象的域名标签。 “ResourceGroupReuse”值表示可以在同一资源组中重复使用对象的域名标签。 “NoReuse”值表示不能在同一资源组、订阅或租户中重复使用对象的域名标签。

dnsNameLabel

string

IP 的 Dns 名称标签。

fqdn

string

IP 的 FQDN。

ip

string

公开给公共 Internet 的 IP。

ports

Port[]

容器组上公开的端口列表。

type

ContainerGroupIpAddressType

指定 IP 是否向公共 Internet 或专用 VNET 公开。

LogAnalytics

容器组日志分析信息。

名称 类型 说明
logType

LogAnalyticsLogType

要使用的日志类型。

metadata

object

日志分析的元数据。

workspaceId

string

Log Analytics 的工作区 ID

workspaceKey

string (password)

Log Analytics 的工作区密钥

workspaceResourceId

string (password)

Log Analytics 的工作区资源 ID

LogAnalyticsLogType

要使用的日志类型。

说明
ContainerInsights

ContainerInsights

ContainerInstanceLogs

容器实例日志

OperatingSystemTypes

容器组中容器所需的操作系统类型。

说明
Windows

Windows操作系统

Linux

Linux

Port

容器组上公开的端口。

名称 类型 说明
port

integer (int32)

端口号。

protocol

ContainerGroupNetworkProtocol

与端口关联的协议。

ResourceLimits

资源限制。

名称 类型 说明
cpu

number (double)

此容器实例的 CPU 限制。

gpu

GpuResource

此容器实例的 GPU 限制。

memoryInGB

number (double)

此容器实例的内存限制(以 GB 为单位)。

ResourceRequests

资源请求。

名称 类型 说明
cpu

number (double)

此容器实例的 CPU 请求。

gpu

GpuResource

此容器实例的 GPU 请求。

memoryInGB

number (double)

此容器实例的内存请求(以 GB 为单位)。

ResourceRequirements

资源要求。

名称 类型 说明
limits

ResourceLimits

此容器实例的资源限制。

requests

ResourceRequests

此容器实例的资源请求。

Scheme

方案。

说明
http

http

https

https

SecurityContextCapabilitiesDefinition

从容器添加或删除的功能。

名称 类型 说明
add

string[]

要添加到容器的功能。

drop

string[]

要从容器中删除的功能。

SecurityContextDefinition

容器的安全上下文。

名称 类型 说明
allowPrivilegeEscalation

boolean

一个布尔值,该值指示 init 进程是否可以提升其特权

capabilities

SecurityContextCapabilitiesDefinition

从容器添加或删除的功能。

privileged

boolean

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

runAsGroup

integer (int32)

设置容器的用户 GID。

runAsUser

integer (int32)

设置容器的用户 UID。

seccompProfile

string

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

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

资源上次修改的时间戳 (UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

Volume

卷的属性。

名称 类型 说明
azureFile

AzureFileVolume

Azure 文件卷。

emptyDir

空目录卷。

gitRepo

GitRepoVolume

git 存储库卷。

name

string

卷的名称。

secret

object

机密卷。

secretReference

object

机密引用卷。

VolumeMount

卷装载的属性。

名称 类型 说明
mountPath

string

应装载卷的容器中的路径。 不得包含冒号 (:)。

name

string

卷装载的名称。

readOnly

boolean

指示卷装载是否为只读的标志。