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

Microsoft.ContainerInstance containerGroups

Bicep 资源定义

可以使用面向以下操作部署 containerGroups 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.ContainerInstance/containerGroups 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.ContainerInstance/containerGroups@2023-05-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  identity: {
    type: 'string'
    userAssignedIdentities: {}
  }
  properties: {
    confidentialComputeProperties: {
      ccePolicy: 'string'
    }
    containers: [
      {
        name: 'string'
        properties: {
          command: [
            'string'
          ]
          environmentVariables: [
            {
              name: 'string'
              secureValue: 'string'
              value: 'string'
            }
          ]
          image: 'string'
          livenessProbe: {
            exec: {
              command: [
                'string'
              ]
            }
            failureThreshold: int
            httpGet: {
              httpHeaders: [
                {
                  name: 'string'
                  value: 'string'
                }
              ]
              path: 'string'
              port: int
              scheme: 'string'
            }
            initialDelaySeconds: int
            periodSeconds: int
            successThreshold: int
            timeoutSeconds: int
          }
          ports: [
            {
              port: int
              protocol: 'string'
            }
          ]
          readinessProbe: {
            exec: {
              command: [
                'string'
              ]
            }
            failureThreshold: int
            httpGet: {
              httpHeaders: [
                {
                  name: 'string'
                  value: 'string'
                }
              ]
              path: 'string'
              port: int
              scheme: 'string'
            }
            initialDelaySeconds: int
            periodSeconds: int
            successThreshold: int
            timeoutSeconds: int
          }
          resources: {
            limits: {
              cpu: int
              gpu: {
                count: int
                sku: 'string'
              }
              memoryInGB: json('decimal-as-string')
            }
            requests: {
              cpu: int
              gpu: {
                count: int
                sku: 'string'
              }
              memoryInGB: json('decimal-as-string')
            }
          }
          securityContext: {
            allowPrivilegeEscalation: bool
            capabilities: {
              add: [
                'string'
              ]
              drop: [
                'string'
              ]
            }
            privileged: bool
            runAsGroup: int
            runAsUser: int
            seccompProfile: 'string'
          }
          volumeMounts: [
            {
              mountPath: 'string'
              name: 'string'
              readOnly: bool
            }
          ]
        }
      }
    ]
    diagnostics: {
      logAnalytics: {
        logType: 'string'
        metadata: {}
        workspaceId: 'string'
        workspaceKey: 'string'
        workspaceResourceId: 'string'
      }
    }
    dnsConfig: {
      nameServers: [
        'string'
      ]
      options: 'string'
      searchDomains: 'string'
    }
    encryptionProperties: {
      identity: 'string'
      keyName: 'string'
      keyVersion: 'string'
      vaultBaseUrl: 'string'
    }
    extensions: [
      {
        name: 'string'
        properties: {
          extensionType: 'string'
          protectedSettings: any()
          settings: any()
          version: 'string'
        }
      }
    ]
    imageRegistryCredentials: [
      {
        identity: 'string'
        identityUrl: 'string'
        password: 'string'
        server: 'string'
        username: 'string'
      }
    ]
    initContainers: [
      {
        name: 'string'
        properties: {
          command: [
            'string'
          ]
          environmentVariables: [
            {
              name: 'string'
              secureValue: 'string'
              value: 'string'
            }
          ]
          image: 'string'
          securityContext: {
            allowPrivilegeEscalation: bool
            capabilities: {
              add: [
                'string'
              ]
              drop: [
                'string'
              ]
            }
            privileged: bool
            runAsGroup: int
            runAsUser: int
            seccompProfile: 'string'
          }
          volumeMounts: [
            {
              mountPath: 'string'
              name: 'string'
              readOnly: bool
            }
          ]
        }
      }
    ]
    ipAddress: {
      autoGeneratedDomainNameLabelScope: 'string'
      dnsNameLabel: 'string'
      ip: 'string'
      ports: [
        {
          port: int
          protocol: 'string'
        }
      ]
      type: 'string'
    }
    osType: 'string'
    priority: 'string'
    restartPolicy: 'string'
    sku: 'string'
    subnetIds: [
      {
        id: 'string'
        name: 'string'
      }
    ]
    volumes: [
      {
        azureFile: {
          readOnly: bool
          shareName: 'string'
          storageAccountKey: 'string'
          storageAccountName: 'string'
        }
        emptyDir: any()
        gitRepo: {
          directory: 'string'
          repository: 'string'
          revision: 'string'
        }
        name: 'string'
        secret: {}
      }
    ]
  }
  zones: [
    'string'
  ]
}

属性值

containerGroups

名称 说明
name 资源名称 字符串 (必需)

字符限制:1-63

有效字符:
小写字母、数字和连字符。

不能以连字符开头或结尾。 不允许连续的连字符。
location 资源位置。 字符串
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
标识 容器组的标识(如果已配置)。 ContainerGroupIdentity
properties 容器组属性 ContainerGroupPropertiesProperties (必需)
zones 容器组的区域。 string[]

ContainerGroupIdentity

名称 说明 Value
type 容器组使用的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”删除容器组中的所有标识。 “None”
“SystemAssigned”
“SystemAssigned, UserAssigned”
“UserAssigned”
userAssignedIdentities 与容器组关联的用户标识列表。 对象 (object)

ContainerGroupPropertiesProperties

名称 说明
confidentialComputeProperties 机密容器组的属性 ConfidentialComputeProperties
containers 容器组中的容器。 Container[] (所需的)
诊断 容器组的诊断信息。 ContainerGroupDiagnostics
dnsConfig 容器组的 DNS 配置信息。 DnsConfiguration
encryptionProperties 容器组的加密属性。 EncryptionProperties
扩展 虚拟 kubelet 使用的扩展 DeploymentExtensionSpec[]
imageRegistryCredentials 创建容器组所依据的映像注册表凭据。 ImageRegistryCredential[]
initContainers 容器组的 Init 容器。 InitContainerDefinition[]
ipAddress 容器组的 IP 地址类型。 IpAddress
osType 容器组中容器所需的操作系统类型。 “Linux”
“Windows” (必需)
priority 容器组的优先级。 “常规”
“Spot”
restartPolicy 容器组中所有容器的重启策略。
- Always 始终重启
- OnFailure 失败时重启
- Never 从不重启
“Always”
“从不”
“OnFailure”
sku 容器组的 SKU。 “机密”
“专用”
“Standard”
subnetId 容器组的子网资源 ID。 ContainerGroupSubnetId[]
volumes 此容器组中的容器可以装载的卷列表。 Volume[]

ConfidentialComputeProperties

名称 说明
ccePolicy base64 编码的机密计算强制策略 string

容器

名称 说明
name 用户提供的容器实例名称。 字符串 (必需)
properties 容器实例的属性。 ContainerProperties (必需)

ContainerProperties

名称 说明 Value
command 要在容器实例中执行的 exec 形式的命令。 string[]
environmentVariables 要在容器实例中设置的环境变量。 EnvironmentVariable[]
image 用于创建容器实例的映像的名称。 字符串 (必需)
livenessProbe 运行情况探测。 ContainerProbe
ports 容器实例上的已公开端口。 ContainerPort[]
readinessProbe 就绪情况探测。 ContainerProbe
resources 容器实例的资源要求。 ResourceRequirements (必需的)
securityContext 容器安全属性。 SecurityContextDefinition
volumeMounts 容器实例可用的卷装入点数。 VolumeMount[]

EnvironmentVariable

名称 说明
name 环境变量的名称。 字符串 (必需)
secureValue 安全环境变量的值。 string
value 环境变量的值。 string

ContainerProbe

名称 说明 Value
exec 要探测的执行命令 ContainerExec
failureThreshold 失败阈值。 int
httpGet 要探测的 Http Get 设置 ContainerHttpGet
initialDelaySeconds 初始延迟秒数。 int
periodSeconds 时间段秒数。 int
successThreshold 成功阈值。 int
timeoutSeconds 超时秒数。 int

ContainerExec

名称 说明 Value
command 要在容器中执行的命令。 string[]

ContainerHttpGet

名称 说明
httpHeaders HTTP 标头。 HttpHeader[]
path 要探测的路径。 string
port 要探测的端口号。 int (必需)
scheme 方案。 “http”
“https”

HttpHeader

名称 说明
name 标头名称。 string
value 标头值。 string

ContainerPort

名称 说明
port 容器组中公开的端口号。 int (必需)
protocol 与端口关联的协议。 “TCP”
“UDP”

ResourceRequirements

名称 说明
限制 此容器实例的资源限制。 ResourceLimits
请求 此容器实例的资源请求。 ResourceRequests (必需)

ResourceLimits

名称 说明
cpu 此容器实例的 CPU 限制。 int
gpu 此容器实例的 GPU 限制。 GpuResource
memoryInGB 此容器实例的内存限制 (GB)。 若要指定十进制值,请使用 json () 函数。 int 或 json decimal

GpuResource

名称 说明 Value
count GPU 资源计数。 int (必需)
sku GPU 资源的 SKU。 “K80”
“P100”
“V100” (必需)

ResourceRequests

名称 说明
cpu 此容器实例的 CPU 请求。 int (必需)
gpu 此容器实例的 GPU 请求。 GpuResource
memoryInGB 此容器实例的内存请求 (GB)。 若要指定十进制值,请使用 json () 函数。 需要 int 或 json decimal ()

SecurityContextDefinition

名称 说明
allowPrivilegeEscalation 一个布尔值,指示 init 进程是否可以提升其特权 bool
capabilities 从容器添加或删除的功能。 SecurityContextCapabilitiesDefinition
特权 用于确定是否将容器权限提升为 Privileged 的标志。 bool
runAsGroup 设置容器的用户 GID。 int
runAsUser 设置容器的用户 UID。 int
seccompProfile 包含 seccomp 配置文件中 JSON 内容的 base64 编码字符串 字符串

SecurityContextCapabilitiesDefinition

名称 说明
add 要添加到容器的功能。 string[]
drop 要从容器中删除的功能。 string[]

VolumeMount

名称 说明
mountPath 容器中要将该卷装载到的路径。 不得包含冒号 (:)。 字符串 (必需)
name 卷装入点的名称。 字符串 (必需)
readOnly 指示卷装入点是否为只读的标志。 bool

ContainerGroupDiagnostics

名称 说明 Value
logAnalytics 容器组日志分析信息。 LogAnalytics

LogAnalytics

名称 说明
logType 要使用的日志类型。 “ContainerInsights”
“ContainerInstanceLogs”
metadata Log Analytics 的元数据。 对象 (object)
workspaceId Log Analytics 的工作区 ID 字符串 (必需)
workspaceKey Log Analytics 的工作区键 字符串 (必需)
workspaceResourceId Log Analytics 的工作区资源 ID string

DnsConfiguration

名称 说明 Value
nameServers 容器组的 DNS 服务器。 string[] (必需的)
options 容器组的 DNS 选项。 字符串
searchDomains 容器组中主机名查找的 DNS 搜索域。 string

EncryptionProperties

名称 说明
标识 keyvault 托管标识。 string
keyName 加密密钥名称。 字符串 (必需)
keyVersion 加密密钥版本。 字符串 (必需)
vaultBaseUrl 密钥保管库基础 URL。 字符串 (必需)

DeploymentExtensionSpec

名称 说明
name 扩展名。 字符串 (必需)
properties 特定于扩展的属性 DeploymentExtensionSpecProperties

DeploymentExtensionSpecProperties

名称 说明
extensionType 要添加的扩展的类型。 字符串 (必需)
protectedSettings 扩展的受保护设置。 对于 Bicep,可以使用 any () 函数。
设置 扩展的设置。 对于 Bicep,可以使用 any () 函数。
版本 正在使用的扩展的版本。 字符串 (必需)

ImageRegistryCredential

名称 说明
标识 专用注册表的标识。 字符串
identityUrl 专用注册表的标识 URL。 string
password 专用注册表的密码。 字符串
server 没有协议(例如“http”或“https”)的 Docker 映像注册表服务器。 字符串 (必需)
username 专用注册表的用户名。 字符串

InitContainerDefinition

名称 说明
name Init 容器的名称。 字符串 (必需)
properties Init 容器的属性。 InitContainerPropertiesDefinition (必需)

InitContainerPropertiesDefinition

名称 说明 Value
command 要在 Init 容器中以 exec 形式执行的命令。 string[]
environmentVariables 要在 Init 容器中设置的环境变量。 EnvironmentVariable[]
image Init 容器的映像。 字符串
securityContext 容器安全属性。 SecurityContextDefinition
volumeMounts 可用于 Init 容器的卷装载。 VolumeMount[]

IpAddress

名称 说明
autoGeneratedDomainNameLabelScope 表示安全枚举的值。 如果未选择“不安全”值,则为默认值,表示对象的域名标签不受子域接管保护。 如果选择“TenantReuse”值,则为默认值,表示可以在同一租户中重复使用对象的域名标签。 “SubscriptionReuse”值表示可以在同一订阅中重复使用对象的域名标签。 “ResourceGroupReuse”值表示可以在同一资源组中重复使用对象的域名标签。 “NoReuse”值表示不能在同一资源组、订阅或租户中重复使用对象的域名标签。 “Noreuse”
“ResourceGroupReuse”
“SubscriptionReuse”
“TenantReuse”
“不安全”
dnsNameLabel IP 的 DNS 名称标签。 字符串
ip 向公共 Internet 公开的 IP。 字符串
ports 容器组上公开的端口列表。 需要 Port[] ()
类型 指定 IP 是否向公共 Internet 或专用 VNET 公开。 “Private”
“公共” ()

端口

名称 说明
port 端口号。 int (必需)
protocol 与端口关联的协议。 'TCP'
'UDP'

ContainerGroupSubnetId

名称 说明 Value
id 虚拟网络和子网的资源 ID。 字符串 (必需)
name 子网的友好名称。 字符串

数据量(Volume)

名称 说明
azureFile Azure 文件卷。 AzureFileVolume
emptyDir 空目录卷。 对于 Bicep,可以使用 any () 函数。
gitRepo Git 存储库卷。 GitRepoVolume
name 卷的名称。 字符串 (必需)
secret 机密卷。 对象 (object)

AzureFileVolume

名称 说明
readOnly 指示以卷形式装载的 Azure 文件共享是否为只读的标志。 bool
shareName 要以卷形式装载的 Azure 文件共享的名称。 字符串 (必需)
storageAccountKey 用于访问 Azure 文件共享的存储帐户访问密钥。 字符串
storageAccountName 包含 Azure 文件共享的存储帐户的名称。 字符串 (必需)

GitRepoVolume

名称 说明 Value
目录 目标目录名称。 不得包含“..”,也不能以其开头。 如果提供了“.”,则卷目录将是 Git 存储库。 否则,卷将包含子目录中具有给定名称的 Git 存储库(如果已指定)。 字符串
repository 存储库 URL 字符串 (必需)
revision 指定的修订版的提交哈希。 字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
在 AKS 上SQL Server可用性组

部署到 Azure
这会创建一个新的 AKS 群集,然后使用使用 Duffle 和 ACI 部署的 CNAB 包将SQL Server可用性组部署到其中
创建 WordPress 站点

部署到 Azure
此模板在容器实例上创建 WordPress 站点
在虚拟网络中创建 WordPress 站点

部署到 Azure
此模板在虚拟网络中的容器实例上创建 WordPress 站点。 并输出可访问 WordPress 站点的公共站点 FQDN。
Azure 容器实例 - BC with SQL Server and IIS

部署到 Azure
在 Azure 容器实例 上部署具有功能齐全的独立 Microsoft Dynamics 365 Business Central 环境的单个 Windows 容器。
带有容器实例和应用程序网关的 Front Door

部署到 Azure
此模板使用容器组和应用程序网关创建 Front Door 标准版/高级版。
Front Door Standard/Premium with Azure 容器实例

部署到 Azure
此模板使用容器组创建 Front Door 标准版/高级版。
Azure 容器实例 - 具有运行状况探测的容器

部署到 Azure
使用 Azure 容器实例 部署具有运行状况探测的 Linux 容器。
Azure 容器实例 - 具有公共 IP 的 Linux 容器

部署到 Azure
使用 Azure 容器实例 部署可通过公共 IP 访问的单个 Linux 容器。
Azure 容器实例 - 具有 secure envVar 的容器

部署到 Azure
使用 Azure 容器实例 部署具有安全环境变量的 Linux 容器。
Azure 容器实例 - 具有 emptyDir 的 Linux 容器

部署到 Azure
使用 Azure 容器实例 部署两个共享 emptyDir 卷的 Linux 容器。
Azure 容器实例 - 包含 gitRepo 的 Linux 容器

部署到 Azure
使用 Azure 容器实例 部署使用 gitRepo 卷的 Linux 容器。
Azure 容器实例 - 包含机密的容器

部署到 Azure
使用 Azure 容器实例 部署具有机密卷的 Linux 容器。
创建具有持久性存储的按需 SFTP 服务器

部署到 Azure
此模板演示使用 Azure 容器实例 (ACI) 的按需 SFTP 服务器。
使用现有存储帐户的按需 SFTP 服务器

部署到 Azure
此模板演示使用 Azure 容器实例 (ACI) 的按需 SFTP 服务器。
通过容器创建存储帐户文件共享

部署到 Azure
此模板通过 azure-cli 在容器实例中创建存储帐户和文件共享
ACI 中的 UDP 容器

部署到 Azure
此模板创建 ACI 资源并通过 UDP 公开容器
Azure 容器实例 - VNet

部署到 Azure
将容器实例部署到 Azure 虚拟网络。
使用证书创建应用程序网关

部署到 Azure
此模板演示如何生成密钥保管库自签名证书,然后从应用程序网关引用。

ARM 模板资源定义

可以使用面向以下操作部署 containerGroups 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.ContainerInstance/containerGroups 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.ContainerInstance/containerGroups",
  "apiVersion": "2023-05-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "identity": {
    "type": "string",
    "userAssignedIdentities": {}
  },
  "properties": {
    "confidentialComputeProperties": {
      "ccePolicy": "string"
    },
    "containers": [
      {
        "name": "string",
        "properties": {
          "command": [ "string" ],
          "environmentVariables": [
            {
              "name": "string",
              "secureValue": "string",
              "value": "string"
            }
          ],
          "image": "string",
          "livenessProbe": {
            "exec": {
              "command": [ "string" ]
            },
            "failureThreshold": "int",
            "httpGet": {
              "httpHeaders": [
                {
                  "name": "string",
                  "value": "string"
                }
              ],
              "path": "string",
              "port": "int",
              "scheme": "string"
            },
            "initialDelaySeconds": "int",
            "periodSeconds": "int",
            "successThreshold": "int",
            "timeoutSeconds": "int"
          },
          "ports": [
            {
              "port": "int",
              "protocol": "string"
            }
          ],
          "readinessProbe": {
            "exec": {
              "command": [ "string" ]
            },
            "failureThreshold": "int",
            "httpGet": {
              "httpHeaders": [
                {
                  "name": "string",
                  "value": "string"
                }
              ],
              "path": "string",
              "port": "int",
              "scheme": "string"
            },
            "initialDelaySeconds": "int",
            "periodSeconds": "int",
            "successThreshold": "int",
            "timeoutSeconds": "int"
          },
          "resources": {
            "limits": {
              "cpu": "int",
              "gpu": {
                "count": "int",
                "sku": "string"
              },
              "memoryInGB": "[json('decimal-as-string')]"
            },
            "requests": {
              "cpu": "int",
              "gpu": {
                "count": "int",
                "sku": "string"
              },
              "memoryInGB": "[json('decimal-as-string')]"
            }
          },
          "securityContext": {
            "allowPrivilegeEscalation": "bool",
            "capabilities": {
              "add": [ "string" ],
              "drop": [ "string" ]
            },
            "privileged": "bool",
            "runAsGroup": "int",
            "runAsUser": "int",
            "seccompProfile": "string"
          },
          "volumeMounts": [
            {
              "mountPath": "string",
              "name": "string",
              "readOnly": "bool"
            }
          ]
        }
      }
    ],
    "diagnostics": {
      "logAnalytics": {
        "logType": "string",
        "metadata": {},
        "workspaceId": "string",
        "workspaceKey": "string",
        "workspaceResourceId": "string"
      }
    },
    "dnsConfig": {
      "nameServers": [ "string" ],
      "options": "string",
      "searchDomains": "string"
    },
    "encryptionProperties": {
      "identity": "string",
      "keyName": "string",
      "keyVersion": "string",
      "vaultBaseUrl": "string"
    },
    "extensions": [
      {
        "name": "string",
        "properties": {
          "extensionType": "string",
          "protectedSettings": {},
          "settings": {},
          "version": "string"
        }
      }
    ],
    "imageRegistryCredentials": [
      {
        "identity": "string",
        "identityUrl": "string",
        "password": "string",
        "server": "string",
        "username": "string"
      }
    ],
    "initContainers": [
      {
        "name": "string",
        "properties": {
          "command": [ "string" ],
          "environmentVariables": [
            {
              "name": "string",
              "secureValue": "string",
              "value": "string"
            }
          ],
          "image": "string",
          "securityContext": {
            "allowPrivilegeEscalation": "bool",
            "capabilities": {
              "add": [ "string" ],
              "drop": [ "string" ]
            },
            "privileged": "bool",
            "runAsGroup": "int",
            "runAsUser": "int",
            "seccompProfile": "string"
          },
          "volumeMounts": [
            {
              "mountPath": "string",
              "name": "string",
              "readOnly": "bool"
            }
          ]
        }
      }
    ],
    "ipAddress": {
      "autoGeneratedDomainNameLabelScope": "string",
      "dnsNameLabel": "string",
      "ip": "string",
      "ports": [
        {
          "port": "int",
          "protocol": "string"
        }
      ],
      "type": "string"
    },
    "osType": "string",
    "priority": "string",
    "restartPolicy": "string",
    "sku": "string",
    "subnetIds": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "volumes": [
      {
        "azureFile": {
          "readOnly": "bool",
          "shareName": "string",
          "storageAccountKey": "string",
          "storageAccountName": "string"
        },
        "emptyDir": {},
        "gitRepo": {
          "directory": "string",
          "repository": "string",
          "revision": "string"
        },
        "name": "string",
        "secret": {}
      }
    ]
  },
  "zones": [ "string" ]
}

属性值

containerGroups

名称 说明 Value
type 资源类型 “Microsoft.ContainerInstance/containerGroups”
apiVersion 资源 API 版本 '2023-05-01'
name 资源名称 字符串 (必需)

字符限制:1-63

有效字符:
小写字母、数字和连字符。

不能以连字符开头或结尾。 不允许连续的连字符。
location 资源位置。 字符串
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
标识 容器组的标识(如果已配置)。 ContainerGroupIdentity
properties 容器组属性 ContainerGroupPropertiesProperties (必需)
zones 容器组的区域。 string[]

ContainerGroupIdentity

名称 说明 Value
type 容器组使用的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”删除容器组中的所有标识。 “None”
“SystemAssigned”
“SystemAssigned, UserAssigned”
“UserAssigned”
userAssignedIdentities 与容器组关联的用户标识列表。 对象 (object)

ContainerGroupPropertiesProperties

名称 说明
confidentialComputeProperties 机密容器组的属性 ConfidentialComputeProperties
containers 容器组中的容器。 Container[] (所需的)
诊断 容器组的诊断信息。 ContainerGroupDiagnostics
dnsConfig 容器组的 DNS 配置信息。 DnsConfiguration
encryptionProperties 容器组的加密属性。 EncryptionProperties
扩展 虚拟 kubelet 使用的扩展 DeploymentExtensionSpec[]
imageRegistryCredentials 创建容器组所依据的映像注册表凭据。 ImageRegistryCredential[]
initContainers 容器组的 Init 容器。 InitContainerDefinition[]
ipAddress 容器组的 IP 地址类型。 IpAddress
osType 容器组中容器所需的操作系统类型。 'Linux'
“Windows” (必需)
priority 容器组的优先级。 'Regular'
“Spot”
restartPolicy 容器组中所有容器的重启策略。
- Always 始终重启
- OnFailure 失败时重启
- Never 从不重启
“Always”
“从不”
“OnFailure”
sku 容器组的 SKU。 “机密”
“专用”
'Standard'
subnetId 容器组的子网资源 ID。 ContainerGroupSubnetId[]
volumes 此容器组中的容器可以装载的卷列表。 Volume[]

ConfidentialComputeProperties

名称 说明
ccePolicy base64 编码的机密计算强制策略 字符串

容器

名称 说明
name 用户提供的容器实例名称。 字符串 (必需)
properties 容器实例的属性。 ContainerProperties (必需)

ContainerProperties

名称 说明 Value
command 要在容器实例中执行的 exec 形式的命令。 string[]
environmentVariables 要在容器实例中设置的环境变量。 EnvironmentVariable[]
image 用于创建容器实例的映像的名称。 字符串 (必需)
livenessProbe 运行情况探测。 ContainerProbe
ports 容器实例上的已公开端口。 ContainerPort[]
readinessProbe 就绪情况探测。 ContainerProbe
resources 容器实例的资源要求。 ResourceRequirements (必需的)
securityContext 容器安全属性。 SecurityContextDefinition
volumeMounts 容器实例可用的卷装入点数。 VolumeMount[]

EnvironmentVariable

名称 说明
name 环境变量的名称。 字符串 (必需)
secureValue 安全环境变量的值。 string
value 环境变量的值。 string

ContainerProbe

名称 说明 Value
exec 要探测的执行命令 ContainerExec
failureThreshold 失败阈值。 int
httpGet 要探测的 Http Get 设置 ContainerHttpGet
initialDelaySeconds 初始延迟秒数。 int
periodSeconds 时间段秒数。 int
successThreshold 成功阈值。 int
timeoutSeconds 超时秒数。 int

ContainerExec

名称 说明 Value
command 要在容器中执行的命令。 string[]

ContainerHttpGet

名称 说明
httpHeaders HTTP 标头。 HttpHeader[]
path 要探测的路径。 string
port 要探测的端口号。 int (必需)
scheme 方案。 “http”
“https”

HttpHeader

名称 说明
name 标头名称。 string
value 标头值。 字符串

ContainerPort

名称 说明
port 容器组中公开的端口号。 int (必需)
protocol 与端口关联的协议。 “TCP”
“UDP”

ResourceRequirements

名称 说明
限制 此容器实例的资源限制。 ResourceLimits
请求 此容器实例的资源请求。 ResourceRequests (所需的)

ResourceLimits

名称 说明
cpu 此容器实例的 CPU 限制。 int
gpu 此容器实例的 GPU 限制。 GpuResource
memoryInGB 此容器实例的内存限制 (GB)。 若要指定十进制值,请使用 json () 函数。 int 或 json decimal

GpuResource

名称 说明 Value
count GPU 资源计数。 int (必需)
sku GPU 资源的 SKU。 'K80'
“P100”
需要“V100” ()

ResourceRequests

名称 说明
cpu 此容器实例的 CPU 请求。 int (必需)
gpu 此容器实例的 GPU 请求。 GpuResource
memoryInGB 此容器实例的内存请求 (GB)。 若要指定十进制值,请使用 json () 函数。 需要 int 或 json decimal ()

SecurityContextDefinition

名称 说明
allowPrivilegeEscalation 一个布尔值,指示初始化进程是否可以提升其特权 bool
capabilities 在容器中添加或删除的功能。 SecurityContextCapabilitiesDefinition
特权 用于确定容器权限是否提升为 Privileged 的标志。 bool
runAsGroup 设置容器的用户 GID。 int
runAsUser 设置容器的用户 UID。 int
seccompProfile 包含 seccomp 配置文件中 JSON 内容的 base64 编码字符串 字符串

SecurityContextCapabilitiesDefinition

名称 说明
add 要添加到容器的功能。 string[]
drop 要从容器中删除的功能。 string[]

VolumeMount

名称 说明
mountPath 容器中要将该卷装载到的路径。 不得包含冒号 (:)。 字符串 (必需)
name 卷装入点的名称。 字符串 (必需)
readOnly 指示卷装入点是否为只读的标志。 bool

ContainerGroupDiagnostics

名称 说明 Value
logAnalytics 容器组日志分析信息。 LogAnalytics

LogAnalytics

名称 说明
logType 要使用的日志类型。 “ContainerInsights”
“ContainerInstanceLogs”
metadata Log Analytics 的元数据。 对象 (object)
workspaceId Log Analytics 的工作区 ID 字符串 (必需)
workspaceKey Log Analytics 的工作区键 字符串 (必需)
workspaceResourceId Log Analytics 的工作区资源 ID 字符串

DnsConfiguration

名称 说明 Value
nameServers 容器组的 DNS 服务器。 string[] (必需)
options 容器组的 DNS 选项。 字符串
searchDomains 容器组中主机名查找的 DNS 搜索域。 字符串

EncryptionProperties

名称 说明
标识 keyvault 托管标识。 字符串
keyName 加密密钥名称。 字符串 (必需)
keyVersion 加密密钥版本。 字符串 (必需)
vaultBaseUrl 密钥保管库基础 URL。 字符串 (必需)

DeploymentExtensionSpec

名称 说明
name 扩展名。 字符串 (必需)
properties 特定于扩展的属性 DeploymentExtensionSpecProperties

DeploymentExtensionSpecProperties

名称 说明
extensionType 要添加的扩展的类型。 字符串 (必需)
protectedSettings 扩展的受保护设置。
设置 扩展的设置。
版本 正在使用的扩展的版本。 字符串 (必需)

ImageRegistryCredential

名称 说明
标识 专用注册表的标识。 字符串
identityUrl 专用注册表的标识 URL。 string
password 专用注册表的密码。 字符串
server 没有协议(例如“http”或“https”)的 Docker 映像注册表服务器。 字符串 (必需)
username 专用注册表的用户名。 字符串

InitContainerDefinition

名称 说明
name Init 容器的名称。 字符串 (必需)
properties Init 容器的属性。 InitContainerPropertiesDefinition (必需)

InitContainerPropertiesDefinition

名称 说明 Value
command 要在 Init 容器中以 exec 形式执行的命令。 string[]
environmentVariables 要在 Init 容器中设置的环境变量。 EnvironmentVariable[]
image Init 容器的映像。 string
securityContext 容器安全属性。 SecurityContextDefinition
volumeMounts 可用于 Init 容器的卷装载。 VolumeMount[]

IpAddress

名称 说明
autoGeneratedDomainNameLabelScope 表示安全枚举的值。 如果未选择“不安全”值,则为默认值,表示对象的域名标签不受子域接管保护。 如果选择“TenantReuse”值,则为默认值,表示可以在同一租户中重复使用对象的域名标签。 “SubscriptionReuse”值表示可以在同一订阅中重复使用对象的域名标签。 “ResourceGroupReuse”值表示可以在同一资源组中重复使用对象的域名标签。 “NoReuse”值表示不能在同一资源组、订阅或租户中重复使用对象的域名标签。 “Noreuse”
“ResourceGroupReuse”
“SubscriptionReuse”
“TenantReuse”
“不安全”
dnsNameLabel IP 的 DNS 名称标签。 string
ip 向公共 Internet 公开的 IP。 string
ports 容器组上公开的端口列表。 需要 Port[] ()
类型 指定 IP 是否向公共 Internet 或专用 VNET 公开。 “Private”
“公共” ()

端口

名称 说明
port 端口号。 int (必需)
protocol 与端口关联的协议。 'TCP'
'UDP'

ContainerGroupSubnetId

名称 说明 Value
id 虚拟网络和子网的资源 ID。 字符串 (必需)
name 子网的友好名称。 字符串

数据量(Volume)

名称 说明
azureFile Azure 文件卷。 AzureFileVolume
emptyDir 空目录卷。
gitRepo Git 存储库卷。 GitRepoVolume
name 卷的名称。 字符串 (必需)
secret 机密卷。 对象 (object)

AzureFileVolume

名称 说明
readOnly 指示以卷形式装载的 Azure 文件共享是否为只读的标志。 bool
shareName 要以卷形式装载的 Azure 文件共享的名称。 字符串 (必需)
storageAccountKey 用于访问 Azure 文件共享的存储帐户访问密钥。 字符串
storageAccountName 包含 Azure 文件共享的存储帐户的名称。 字符串 (必需)

GitRepoVolume

名称 说明 Value
目录 目标目录名称。 不得包含“..”,也不能以其开头。 如果提供了“.”,则卷目录将是 Git 存储库。 否则,卷将包含子目录中具有给定名称的 Git 存储库(如果已指定)。 字符串
repository 存储库 URL 字符串 (必需)
revision 指定的修订版的提交哈希。 string

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
在 AKS 上SQL Server可用性组

部署到 Azure
这会创建一个新的 AKS 群集,然后使用使用 Duffle 和 ACI 部署的 CNAB 包将SQL Server可用性组部署到其中
创建 WordPress 站点

部署到 Azure
此模板在容器实例上创建 WordPress 站点
在虚拟网络中创建 WordPress 站点

部署到 Azure
此模板在虚拟网络中的容器实例上创建 WordPress 站点。 并输出可访问 WordPress 站点的公共站点 FQDN。
Azure 容器实例 - BC with SQL Server and IIS

部署到 Azure
在 Azure 容器实例 上部署具有功能齐全的独立 Microsoft Dynamics 365 Business Central 环境的单个 Windows 容器。
带有容器实例和应用程序网关的 Front Door

部署到 Azure
此模板使用容器组和应用程序网关创建 Front Door 标准版/高级版。
Front Door Standard/Premium with Azure 容器实例

部署到 Azure
此模板使用容器组创建 Front Door 标准版/高级版。
Azure 容器实例 - 具有运行状况探测的容器

部署到 Azure
使用 Azure 容器实例 部署具有运行状况探测的 Linux 容器。
Azure 容器实例 - 具有公共 IP 的 Linux 容器

部署到 Azure
使用 Azure 容器实例 部署可通过公共 IP 访问的单个 Linux 容器。
Azure 容器实例 - 具有 secure envVar 的容器

部署到 Azure
使用 Azure 容器实例 部署具有安全环境变量的 Linux 容器。
Azure 容器实例 - 具有 emptyDir 的 Linux 容器

部署到 Azure
使用 Azure 容器实例 部署两个共享 emptyDir 卷的 Linux 容器。
Azure 容器实例 - 包含 gitRepo 的 Linux 容器

部署到 Azure
使用 Azure 容器实例 部署使用 gitRepo 卷的 Linux 容器。
Azure 容器实例 - 包含机密的容器

部署到 Azure
使用 Azure 容器实例 部署具有机密卷的 Linux 容器。
创建具有持久性存储的按需 SFTP 服务器

部署到 Azure
此模板演示使用 Azure 容器实例 (ACI) 的按需 SFTP 服务器。
使用现有存储帐户的按需 SFTP 服务器

部署到 Azure
此模板演示使用 Azure 容器实例 (ACI) 的按需 SFTP 服务器。
通过容器创建存储帐户文件共享

部署到 Azure
此模板通过 azure-cli 在容器实例中创建存储帐户和文件共享
ACI 中的 UDP 容器

部署到 Azure
此模板创建 ACI 资源并通过 UDP 公开容器
Azure 容器实例 - VNet

部署到 Azure
将容器实例部署到 Azure 虚拟网络。
使用证书创建应用程序网关

部署到 Azure
此模板演示如何生成密钥保管库自签名证书,然后从应用程序网关引用。

Terraform (AzAPI 提供程序) 资源定义

可以使用面向以下操作部署 containerGroups 资源类型:

  • 资源组

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.ContainerInstance/containerGroups 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.ContainerInstance/containerGroups@2023-05-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type = "string"
    identity_ids = []
  }
  body = jsonencode({
    properties = {
      confidentialComputeProperties = {
        ccePolicy = "string"
      }
      containers = [
        {
          name = "string"
          properties = {
            command = [
              "string"
            ]
            environmentVariables = [
              {
                name = "string"
                secureValue = "string"
                value = "string"
              }
            ]
            image = "string"
            livenessProbe = {
              exec = {
                command = [
                  "string"
                ]
              }
              failureThreshold = int
              httpGet = {
                httpHeaders = [
                  {
                    name = "string"
                    value = "string"
                  }
                ]
                path = "string"
                port = int
                scheme = "string"
              }
              initialDelaySeconds = int
              periodSeconds = int
              successThreshold = int
              timeoutSeconds = int
            }
            ports = [
              {
                port = int
                protocol = "string"
              }
            ]
            readinessProbe = {
              exec = {
                command = [
                  "string"
                ]
              }
              failureThreshold = int
              httpGet = {
                httpHeaders = [
                  {
                    name = "string"
                    value = "string"
                  }
                ]
                path = "string"
                port = int
                scheme = "string"
              }
              initialDelaySeconds = int
              periodSeconds = int
              successThreshold = int
              timeoutSeconds = int
            }
            resources = {
              limits = {
                cpu = int
                gpu = {
                  count = int
                  sku = "string"
                }
                memoryInGB = "decimal-as-string"
              }
              requests = {
                cpu = int
                gpu = {
                  count = int
                  sku = "string"
                }
                memoryInGB = "decimal-as-string"
              }
            }
            securityContext = {
              allowPrivilegeEscalation = bool
              capabilities = {
                add = [
                  "string"
                ]
                drop = [
                  "string"
                ]
              }
              privileged = bool
              runAsGroup = int
              runAsUser = int
              seccompProfile = "string"
            }
            volumeMounts = [
              {
                mountPath = "string"
                name = "string"
                readOnly = bool
              }
            ]
          }
        }
      ]
      diagnostics = {
        logAnalytics = {
          logType = "string"
          metadata = {}
          workspaceId = "string"
          workspaceKey = "string"
          workspaceResourceId = "string"
        }
      }
      dnsConfig = {
        nameServers = [
          "string"
        ]
        options = "string"
        searchDomains = "string"
      }
      encryptionProperties = {
        identity = "string"
        keyName = "string"
        keyVersion = "string"
        vaultBaseUrl = "string"
      }
      extensions = [
        {
          name = "string"
          properties = {
            extensionType = "string"
            version = "string"
          }
        }
      ]
      imageRegistryCredentials = [
        {
          identity = "string"
          identityUrl = "string"
          password = "string"
          server = "string"
          username = "string"
        }
      ]
      initContainers = [
        {
          name = "string"
          properties = {
            command = [
              "string"
            ]
            environmentVariables = [
              {
                name = "string"
                secureValue = "string"
                value = "string"
              }
            ]
            image = "string"
            securityContext = {
              allowPrivilegeEscalation = bool
              capabilities = {
                add = [
                  "string"
                ]
                drop = [
                  "string"
                ]
              }
              privileged = bool
              runAsGroup = int
              runAsUser = int
              seccompProfile = "string"
            }
            volumeMounts = [
              {
                mountPath = "string"
                name = "string"
                readOnly = bool
              }
            ]
          }
        }
      ]
      ipAddress = {
        autoGeneratedDomainNameLabelScope = "string"
        dnsNameLabel = "string"
        ip = "string"
        ports = [
          {
            port = int
            protocol = "string"
          }
        ]
        type = "string"
      }
      osType = "string"
      priority = "string"
      restartPolicy = "string"
      sku = "string"
      subnetIds = [
        {
          id = "string"
          name = "string"
        }
      ]
      volumes = [
        {
          azureFile = {
            readOnly = bool
            shareName = "string"
            storageAccountKey = "string"
            storageAccountName = "string"
          }
          gitRepo = {
            directory = "string"
            repository = "string"
            revision = "string"
          }
          name = "string"
          secret = {}
        }
      ]
    }
    zones = [
      "string"
    ]
  })
}

属性值

containerGroups

名称 说明 Value
type 资源类型 “Microsoft.ContainerInstance/containerGroups@2023-05-01”
name 资源名称 字符串 (必需)

字符限制:1-63

有效字符:
小写字母、数字和连字符。

不能以连字符开头或结尾。 不允许连续的连字符。
location 资源位置。 string
parent_id 若要部署到资源组,请使用该资源组的 ID。 字符串 (必需)
标记 资源标记。 标记名称和值的字典。
标识 容器组的标识(如果已配置)。 ContainerGroupIdentity
properties 容器组属性 ContainerGroupPropertiesProperties (必需)
zones 容器组的区域。 string[]

ContainerGroupIdentity

名称 说明 Value
type 容器组使用的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”删除容器组中的所有标识。 “SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
identity_ids 与容器组关联的用户标识列表。 用户标识 ID 的数组。

ContainerGroupPropertiesProperties

名称 说明
confidentialComputeProperties 机密容器组的属性 ConfidentialComputeProperties
containers 容器组中的容器。 Container[] (所需的)
诊断 容器组的诊断信息。 ContainerGroupDiagnostics
dnsConfig 容器组的 DNS 配置信息。 DnsConfiguration
encryptionProperties 容器组的加密属性。 EncryptionProperties
扩展 虚拟 kubelet 使用的扩展 DeploymentExtensionSpec[]
imageRegistryCredentials 创建容器组所依据的映像注册表凭据。 ImageRegistryCredential[]
initContainers 容器组的 Init 容器。 InitContainerDefinition[]
ipAddress 容器组的 IP 地址类型。 IpAddress
osType 容器组中容器所需的操作系统类型。 “Linux”
“Windows” (必需)
priority 容器组的优先级。 “Regular”
“Spot”
restartPolicy 容器组中所有容器的重启策略。
- Always 始终重启
- OnFailure 失败时重启
- Never 从不重启
“Always”
“Never”
“OnFailure”
sku 容器组的 SKU。 “机密”
“专用”
“Standard”
subnetId 容器组的子网资源 ID。 ContainerGroupSubnetId[]
volumes 此容器组中的容器可以装载的卷列表。 Volume[]

ConfidentialComputeProperties

名称 说明
ccePolicy base64 编码的机密计算强制策略 string

容器

名称 说明
name 用户提供的容器实例名称。 字符串 (必需)
properties 容器实例的属性。 ContainerProperties (必需)

ContainerProperties

名称 说明 Value
command 要在容器实例中执行的 exec 形式的命令。 string[]
environmentVariables 要在容器实例中设置的环境变量。 EnvironmentVariable[]
image 用于创建容器实例的映像的名称。 字符串 (必需)
livenessProbe 运行情况探测。 ContainerProbe
ports 容器实例上的已公开端口。 ContainerPort[]
readinessProbe 就绪情况探测。 ContainerProbe
resources 容器实例的资源要求。 ResourceRequirements (必需)
securityContext 容器安全属性。 SecurityContextDefinition
volumeMounts 容器实例可用的卷装入点数。 VolumeMount[]

EnvironmentVariable

名称 说明
name 环境变量的名称。 字符串 (必需)
secureValue 安全环境变量的值。 string
value 环境变量的值。 字符串

ContainerProbe

名称 说明 Value
exec 要探测的执行命令 ContainerExec
failureThreshold 失败阈值。 int
httpGet 要探测的 Http Get 设置 ContainerHttpGet
initialDelaySeconds 初始延迟秒数。 int
periodSeconds 时间段秒数。 int
successThreshold 成功阈值。 int
timeoutSeconds 超时秒数。 int

ContainerExec

名称 说明 Value
command 要在容器中执行的命令。 string[]

ContainerHttpGet

名称 说明
httpHeaders HTTP 标头。 HttpHeader[]
path 要探测的路径。 string
port 要探测的端口号。 int (必需)
scheme 方案。 “http”
“https”

HttpHeader

名称 说明
name 标头名称。 string
value 标头值。 string

ContainerPort

名称 说明
port 容器组中公开的端口号。 int (必需)
protocol 与端口关联的协议。 “TCP”
“UDP”

ResourceRequirements

名称 说明
限制 此容器实例的资源限制。 ResourceLimits
请求 此容器实例的资源请求。 ResourceRequests (所需的)

ResourceLimits

名称 说明
cpu 此容器实例的 CPU 限制。 int
gpu 此容器实例的 GPU 限制。 GpuResource
memoryInGB 此容器实例的内存限制 (GB)。 将十进制值指定为字符串。 int 或 json decimal

GpuResource

名称 说明 Value
count GPU 资源计数。 int (必需)
sku GPU 资源的 SKU。 “K80”
“P100”
需要“V100” ()

ResourceRequests

名称 说明
cpu 此容器实例的 CPU 请求。 int (必需)
gpu 此容器实例的 GPU 请求。 GpuResource
memoryInGB 此容器实例的内存请求 (GB)。 将十进制值指定为字符串。 需要 int 或 json decimal ()

SecurityContextDefinition

名称 说明
allowPrivilegeEscalation 一个布尔值,指示初始化进程是否可以提升其特权 bool
capabilities 在容器中添加或删除的功能。 SecurityContextCapabilitiesDefinition
特权 用于确定容器权限是否提升为 Privileged 的标志。 bool
runAsGroup 设置容器的用户 GID。 int
runAsUser 设置容器的用户 UID。 int
seccompProfile 包含 seccomp 配置文件中 JSON 内容的 base64 编码字符串 字符串

SecurityContextCapabilitiesDefinition

名称 说明
add 要添加到容器的功能。 string[]
drop 要从容器中删除的功能。 string[]

VolumeMount

名称 说明
mountPath 容器中要将该卷装载到的路径。 不得包含冒号 (:)。 字符串 (必需)
name 卷装入点的名称。 字符串 (必需)
readOnly 指示卷装入点是否为只读的标志。 bool

ContainerGroupDiagnostics

名称 说明 Value
logAnalytics 容器组日志分析信息。 LogAnalytics

LogAnalytics

名称 说明
logType 要使用的日志类型。 “ContainerInsights”
“ContainerInstanceLogs”
metadata Log Analytics 的元数据。 对象 (object)
workspaceId Log Analytics 的工作区 ID 字符串 (必需)
workspaceKey Log Analytics 的工作区键 字符串 (必需)
workspaceResourceId Log Analytics 的工作区资源 ID 字符串

DnsConfiguration

名称 说明 Value
nameServers 容器组的 DNS 服务器。 string[] (必需)
options 容器组的 DNS 选项。 string
searchDomains 容器组中主机名查找的 DNS 搜索域。 字符串

EncryptionProperties

名称 说明
标识 keyvault 托管标识。 字符串
keyName 加密密钥名称。 字符串 (必需)
keyVersion 加密密钥版本。 字符串 (必需)
vaultBaseUrl 密钥保管库基础 URL。 字符串 (必需)

DeploymentExtensionSpec

名称 说明
name 扩展名。 字符串 (必需)
properties 特定于扩展的属性 DeploymentExtensionSpecProperties

DeploymentExtensionSpecProperties

名称 说明
extensionType 要添加的扩展的类型。 字符串 (必需)
protectedSettings 扩展的受保护设置。
设置 扩展的设置。
版本 正在使用的扩展的版本。 字符串 (必需)

ImageRegistryCredential

名称 说明
标识 专用注册表的标识。 字符串
identityUrl 专用注册表的标识 URL。 string
password 专用注册表的密码。 字符串
server 没有协议(例如“http”或“https”)的 Docker 映像注册表服务器。 字符串 (必需)
username 专用注册表的用户名。 字符串

InitContainerDefinition

名称 说明
name Init 容器的名称。 字符串 (必需)
properties Init 容器的属性。 InitContainerPropertiesDefinition (必需)

InitContainerPropertiesDefinition

名称 说明 Value
command 要在 Init 容器中以 exec 形式执行的命令。 string[]
environmentVariables 要在 Init 容器中设置的环境变量。 EnvironmentVariable[]
image Init 容器的映像。 字符串
securityContext 容器安全属性。 SecurityContextDefinition
volumeMounts 可用于 Init 容器的卷装载。 VolumeMount[]

IpAddress

名称 说明
autoGeneratedDomainNameLabelScope 表示安全枚举的值。 如果未选择“不安全”值,则为默认值,表示对象的域名标签不受子域接管保护。 如果选择“TenantReuse”值,则为默认值,表示可以在同一租户中重复使用对象的域名标签。 “SubscriptionReuse”值表示可以在同一订阅中重复使用对象的域名标签。 “ResourceGroupReuse”值表示可以在同一资源组中重复使用对象的域名标签。 “NoReuse”值表示不能在同一资源组、订阅或租户中重复使用对象的域名标签。 “Noreuse”
“ResourceGroupReuse”
“SubscriptionReuse”
“TenantReuse”
“不安全”
dnsNameLabel IP 的 DNS 名称标签。 字符串
ip 向公共 Internet 公开的 IP。 string
ports 容器组上公开的端口列表。 需要 Port[] ()
类型 指定 IP 是否向公共 Internet 或专用 VNET 公开。 “Private”
需要“公共” ()

端口

名称 说明
port 端口号。 int (必需)
protocol 与端口关联的协议。 “TCP”
“UDP”

ContainerGroupSubnetId

名称 说明 Value
id 虚拟网络和子网的资源 ID。 字符串 (必需)
name 子网的友好名称。 string

数据量(Volume)

名称 说明
azureFile Azure 文件卷。 AzureFileVolume
emptyDir 空目录卷。
gitRepo Git 存储库卷。 GitRepoVolume
name 卷的名称。 字符串 (必需)
secret 机密卷。 对象 (object)

AzureFileVolume

名称 说明
readOnly 指示以卷形式装载的 Azure 文件共享是否为只读的标志。 bool
shareName 要以卷形式装载的 Azure 文件共享的名称。 字符串 (必需)
storageAccountKey 用于访问 Azure 文件共享的存储帐户访问密钥。 字符串
storageAccountName 包含 Azure 文件共享的存储帐户的名称。 字符串 (必需)

GitRepoVolume

名称 说明 Value
目录 目标目录名称。 不得包含“..”,也不能以其开头。 如果提供了“.”,则卷目录将是 Git 存储库。 否则,卷将包含子目录中具有给定名称的 Git 存储库(如果已指定)。 字符串
repository 存储库 URL 字符串 (必需)
revision 指定的修订版的提交哈希。 字符串