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

Jobs - Create Or Update

创建或更新容器应用作业。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}?api-version=2025-01-01

URI 参数

名称 必需 类型 说明
jobName
path True

string

pattern: ^[-\w\._\(\)]+$

作业名称

resourceGroupName
path True

string

minLength: 1
maxLength: 90

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

subscriptionId
path True

string

minLength: 1

目标订阅的 ID。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源所在的地理位置

identity

ManagedServiceIdentity

容器应用作业需要托管标识才能与其他 Azure 服务交互,以不维护代码中的任何机密或凭据。

properties.configuration

JobConfiguration

容器应用作业配置属性。

properties.environmentId

string

环境的资源 ID。

properties.template

JobTemplate

容器应用作业定义。

properties.workloadProfileName

string

用于固定容器应用作业执行的工作负荷配置文件名称。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

Job

对容器应用作业不执行任何更改。

201 Created

Job

容器应用作业创建已启动。

Other Status Codes

DefaultErrorResponse

常见的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

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

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create or Update Container Apps Job
Create or Update Container Apps Job With Event Driven Trigger

Create or Update Container Apps Job

示例请求

PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerappsjob0?api-version=2025-01-01

{
  "location": "East US",
  "identity": {
    "type": "SystemAssigned,UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}
    }
  },
  "properties": {
    "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
    "configuration": {
      "replicaTimeout": 10,
      "replicaRetryLimit": 10,
      "manualTriggerConfig": {
        "replicaCompletionCount": 1,
        "parallelism": 4
      },
      "triggerType": "Manual",
      "identitySettings": [
        {
          "identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
          "lifecycle": "All"
        },
        {
          "identity": "system",
          "lifecycle": "Init"
        }
      ]
    },
    "template": {
      "containers": [
        {
          "image": "repo/testcontainerappsjob0:v1",
          "name": "testcontainerappsjob0",
          "probes": [
            {
              "type": "Liveness",
              "httpGet": {
                "path": "/health",
                "port": 8080,
                "httpHeaders": [
                  {
                    "name": "Custom-Header",
                    "value": "Awesome"
                  }
                ]
              },
              "initialDelaySeconds": 5,
              "periodSeconds": 3
            }
          ],
          "volumeMounts": [
            {
              "volumeName": "azurefile",
              "mountPath": "/mnt/path1",
              "subPath": "subPath1"
            },
            {
              "volumeName": "nfsazurefile",
              "mountPath": "/mnt/path2",
              "subPath": "subPath2"
            }
          ]
        }
      ],
      "initContainers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testinitcontainerAppsJob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "command": [
            "/bin/sh"
          ],
          "args": [
            "-c",
            "while true; do echo hello; sleep 10;done"
          ]
        }
      ],
      "volumes": [
        {
          "name": "azurefile",
          "storageType": "AzureFile",
          "storageName": "storage"
        },
        {
          "name": "nfsazurefile",
          "storageType": "NfsAzureFile",
          "storageName": "nfsStorage"
        }
      ]
    }
  }
}

示例响应

{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerappsjob0",
  "name": "testcontainerappsjob0",
  "type": "Microsoft.App/jobs",
  "location": "East US",
  "identity": {
    "type": "SystemAssigned,UserAssigned",
    "principalId": "24adfa4f-dedf-8dc0-ca29-b6d1a69ab319",
    "tenantId": "23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0",
    "userAssignedIdentities": {
      "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {
        "principalId": "74adfa4f-dedf-8dc0-ca29-b6d1a69ab312",
        "clientId": "14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"
      }
    }
  },
  "properties": {
    "provisioningState": "InProgress",
    "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
    "configuration": {
      "replicaTimeout": 10,
      "replicaRetryLimit": 10,
      "manualTriggerConfig": {
        "replicaCompletionCount": 1,
        "parallelism": 4
      },
      "triggerType": "Manual",
      "identitySettings": [
        {
          "identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
          "lifecycle": "All"
        },
        {
          "identity": "system",
          "lifecycle": "Init"
        }
      ]
    },
    "template": {
      "containers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testcontainerappsjob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "probes": [
            {
              "type": "Liveness",
              "httpGet": {
                "path": "/health",
                "port": 8080,
                "httpHeaders": [
                  {
                    "name": "Custom-Header",
                    "value": "Awesome"
                  }
                ]
              },
              "initialDelaySeconds": 3,
              "periodSeconds": 3
            }
          ],
          "volumeMounts": [
            {
              "volumeName": "azurefile",
              "mountPath": "/mnt/path1",
              "subPath": "subPath1"
            },
            {
              "volumeName": "nfsazurefile",
              "mountPath": "/mnt/path2",
              "subPath": "subPath2"
            }
          ]
        }
      ],
      "initContainers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testinitcontainerAppsJob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "command": [
            "/bin/sh"
          ],
          "args": [
            "-c",
            "while true; do echo hello; sleep 10;done"
          ]
        }
      ],
      "volumes": [
        {
          "name": "azurefile",
          "storageType": "AzureFile",
          "storageName": "storage"
        },
        {
          "name": "nfsazurefile",
          "storageType": "NfsAzureFile",
          "storageName": "nfsStorage"
        }
      ]
    },
    "eventStreamEndpoint": "testEndpoint"
  }
}
Location: location
{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerappsjob0",
  "name": "testcontainerappsjob0",
  "type": "Microsoft.App/jobs",
  "location": "East US",
  "identity": {
    "type": "SystemAssigned,UserAssigned",
    "principalId": "24adfa4f-dedf-8dc0-ca29-b6d1a69ab319",
    "tenantId": "23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0",
    "userAssignedIdentities": {
      "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {
        "principalId": "74adfa4f-dedf-8dc0-ca29-b6d1a69ab312",
        "clientId": "14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"
      }
    }
  },
  "properties": {
    "provisioningState": "InProgress",
    "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
    "configuration": {
      "replicaTimeout": 10,
      "replicaRetryLimit": 10,
      "manualTriggerConfig": {
        "replicaCompletionCount": 1,
        "parallelism": 4
      },
      "triggerType": "Manual",
      "identitySettings": [
        {
          "identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity",
          "lifecycle": "All"
        },
        {
          "identity": "system",
          "lifecycle": "Init"
        }
      ]
    },
    "template": {
      "containers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testcontainerappsjob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "probes": [
            {
              "type": "Liveness",
              "httpGet": {
                "path": "/health",
                "port": 8080,
                "httpHeaders": [
                  {
                    "name": "Custom-Header",
                    "value": "Awesome"
                  }
                ]
              },
              "initialDelaySeconds": 3,
              "periodSeconds": 3
            }
          ],
          "volumeMounts": [
            {
              "volumeName": "azurefile",
              "mountPath": "/mnt/path1",
              "subPath": "subPath1"
            },
            {
              "volumeName": "nfsazurefile",
              "mountPath": "/mnt/path2",
              "subPath": "subPath2"
            }
          ]
        }
      ],
      "initContainers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testinitcontainerAppsJob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "command": [
            "/bin/sh"
          ],
          "args": [
            "-c",
            "while true; do echo hello; sleep 10;done"
          ]
        }
      ],
      "volumes": [
        {
          "name": "azurefile",
          "storageType": "AzureFile",
          "storageName": "storage"
        },
        {
          "name": "nfsazurefile",
          "storageType": "NfsAzureFile",
          "storageName": "nfsStorage"
        }
      ]
    },
    "eventStreamEndpoint": "testEndpoint"
  }
}

Create or Update Container Apps Job With Event Driven Trigger

示例请求

PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerappsjob0?api-version=2025-01-01

{
  "location": "East US",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}
    }
  },
  "properties": {
    "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
    "configuration": {
      "replicaTimeout": 10,
      "replicaRetryLimit": 10,
      "eventTriggerConfig": {
        "replicaCompletionCount": 1,
        "parallelism": 4,
        "scale": {
          "pollingInterval": 40,
          "minExecutions": 1,
          "maxExecutions": 5,
          "rules": [
            {
              "name": "servicebuscalingrule",
              "type": "azure-servicebus",
              "metadata": {
                "topicName": "my-topic"
              },
              "identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"
            }
          ]
        }
      },
      "triggerType": "Event"
    },
    "template": {
      "containers": [
        {
          "image": "repo/testcontainerappsjob0:v1",
          "name": "testcontainerappsjob0"
        }
      ],
      "initContainers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testinitcontainerAppsJob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "command": [
            "/bin/sh"
          ],
          "args": [
            "-c",
            "while true; do echo hello; sleep 10;done"
          ]
        }
      ]
    }
  }
}

示例响应

{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerappsjob0",
  "name": "testcontainerappsjob0",
  "type": "Microsoft.App/jobs",
  "location": "East US",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {
        "principalId": "74adfa4f-dedf-8dc0-ca29-b6d1a69ab312",
        "clientId": "14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"
      }
    }
  },
  "properties": {
    "provisioningState": "InProgress",
    "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
    "configuration": {
      "replicaTimeout": 10,
      "replicaRetryLimit": 10,
      "eventTriggerConfig": {
        "replicaCompletionCount": 1,
        "parallelism": 4,
        "scale": {
          "pollingInterval": 20,
          "minExecutions": 1,
          "maxExecutions": 5,
          "rules": [
            {
              "name": "servicebuscalingrule",
              "type": "azure-servicebus",
              "metadata": {
                "topicName": "my-topic"
              },
              "identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"
            }
          ]
        }
      },
      "triggerType": "Event"
    },
    "template": {
      "containers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testcontainerappsjob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          }
        }
      ],
      "initContainers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testinitcontainerAppsJob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "command": [
            "/bin/sh"
          ],
          "args": [
            "-c",
            "while true; do echo hello; sleep 10;done"
          ]
        }
      ]
    },
    "eventStreamEndpoint": "testEndpoint"
  }
}
Location: location
{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerappsjob0",
  "name": "testcontainerappsjob0",
  "type": "Microsoft.App/jobs",
  "location": "East US",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {
        "principalId": "74adfa4f-dedf-8dc0-ca29-b6d1a69ab312",
        "clientId": "14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"
      }
    }
  },
  "properties": {
    "provisioningState": "InProgress",
    "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
    "configuration": {
      "replicaTimeout": 10,
      "replicaRetryLimit": 10,
      "eventTriggerConfig": {
        "replicaCompletionCount": 1,
        "parallelism": 4,
        "scale": {
          "minExecutions": 1,
          "maxExecutions": 5,
          "pollingInterval": 20,
          "rules": [
            {
              "name": "servicebuscalingrule",
              "type": "azure-servicebus",
              "metadata": {
                "queueName": "my-queue",
                "messageCount": "50"
              },
              "identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"
            }
          ]
        }
      },
      "triggerType": "Event"
    },
    "template": {
      "containers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testcontainerappsjob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          }
        }
      ],
      "initContainers": [
        {
          "image": "repo/testcontainerappsjob0:v4",
          "name": "testinitcontainerAppsJob0",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          },
          "command": [
            "/bin/sh"
          ],
          "args": [
            "-c",
            "while true; do echo hello; sleep 10;done"
          ]
        }
      ]
    },
    "eventStreamEndpoint": "testEndpoint"
  }
}

定义

名称 说明
Container

容器应用容器定义

ContainerAppProbe

探测描述要针对容器执行的运行状况检查,以确定它是活动状态还是已准备好接收流量。

ContainerResources

容器应用容器资源要求。

createdByType

创建资源的标识的类型。

DefaultErrorResponse

应用服务错误响应。

Details

详细信息或错误

EnvironmentVar

容器应用容器环境变量。

Error

错误模型。

EventTriggerConfig

触发事件驱动作业的配置。

HttpGet

HTTPGet 指定要执行的 http 请求。

HttpHeaders

在请求中设置的自定义标头。 HTTP 允许重复标头。

IdentitySettings

分配给容器应用的托管标识的可选设置。

IdentitySettingsLifeCycle

用于选择容器应用的生命周期阶段,在此期间应提供托管标识。

InitContainer

容器应用 init 容器定义

Job

容器应用作业

JobConfiguration

非版本控制容器应用作业配置属性

JobProvisioningState

容器应用作业的预配状态。

JobScale

缩放事件驱动作业的配置。

JobScaleRule

缩放规则。

JobTemplate

容器应用作业版本控制的应用程序定义。 定义不可变修订的所需状态。 对本部分所做的任何更改都将导致创建新的修订

ManagedServiceIdentity

托管服务标识(系统分配和/或用户分配的标识)

ManagedServiceIdentityType

托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。

ManualTriggerConfig

单个执行作业的手动触发器配置。 属性 replicaCompletionCount 和并行度默认设置为 1

RegistryCredentials

容器应用专用注册表

ScaleRuleAuth

缩放规则的身份验证机密

ScheduleTriggerConfig

Cron 格式化了 cronjobs 的重复触发器计划(“* * * *”)。 默认情况下,属性完成和并行度设置为 1

Scheme

用于连接到主机的方案。 默认为 HTTP。

Secret

机密定义。

SecretVolumeItem

要添加到卷的机密。

StorageType

卷的存储类型。 如果未提供,请使用 EmptyDir。

systemData

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

TcpSocket

TCPSocket 指定涉及 TCP 端口的操作。 尚不支持 TCP 挂钩。

TriggerType

作业的触发器类型

Type

探测的类型。

UserAssignedIdentity

用户分配的标识属性

Volume

容器应用的卷定义。

VolumeMount

容器应用的卷装载。

Container

容器应用容器定义

名称 类型 说明
args

string[]

容器启动命令参数。

command

string[]

容器启动命令。

env

EnvironmentVar[]

容器环境变量。

image

string

容器映像标记。

name

string

自定义容器名称。

probes

ContainerAppProbe[]

容器的探测列表。

resources

ContainerResources

容器资源要求。

volumeMounts

VolumeMount[]

容器卷装载。

ContainerAppProbe

探测描述要针对容器执行的运行状况检查,以确定它是活动状态还是已准备好接收流量。

名称 类型 说明
failureThreshold

integer (int32)

探测在成功后被视为失败的最小连续失败。 默认值为 3。 最小值为 1。 最大值为 10。

httpGet

HttpGet

HTTPGet 指定要执行的 http 请求。

initialDelaySeconds

integer (int32)

启动生存情况探测之前容器启动后的秒数。 最小值为 1。 最大值为 60。

periodSeconds

integer (int32)

执行探测的频率(以秒为单位)。 默认值为 10 秒。 最小值为 1。 最大值为 240。

successThreshold

integer (int32)

探测在失败后被视为成功的最小连续成功次数。 默认值为 1。 对于实时性和启动,必须为 1。 最小值为 1。 最大值为 10。

tcpSocket

TcpSocket

TCPSocket 指定涉及 TCP 端口的操作。 尚不支持 TCP 挂钩。

terminationGracePeriodSeconds

integer (int64)

Pod 在探测失败时需要正常终止的可选持续时间(以秒为单位)。 宽限期是 Pod 中运行的进程发送终止信号以及进程强行停止并带有终止信号的时间(以秒为单位)。 设置此值的时间超过进程的预期清理时间。 如果此值为 nil,将使用 Pod 的 terminationGracePeriodSeconds。 否则,此值将替代 Pod 规范提供的值。值必须是非负整数。 值零表示通过终止信号立即停止(没有关闭机会)。 这是 alpha 字段,需要启用 ProbeTerminationGracePeriod 功能门。 最大值为 3600 秒(1 小时)

timeoutSeconds

integer (int32)

探测超时的秒数。默认值为 1 秒。 最小值为 1。 最大值为 240。

type

Type

探测的类型。

ContainerResources

容器应用容器资源要求。

名称 类型 说明
cpu

number (double)

核心中所需的 CPU,例如 0.5

ephemeralStorage

string

临时存储,例如“1Gi”

memory

string

所需的内存,例如“250Mb”

createdByType

创建资源的标识的类型。

说明
Application
Key
ManagedIdentity
User

DefaultErrorResponse

应用服务错误响应。

名称 类型 说明
error

Error

错误模型。

Details

详细信息或错误

名称 类型 说明
code

string

标准化字符串,以编程方式标识错误。

message

string

详细的错误说明和调试信息。

target

string

详细的错误说明和调试信息。

EnvironmentVar

容器应用容器环境变量。

名称 类型 说明
name

string

环境变量名称。

secretRef

string

要从中拉取环境变量值的容器应用机密的名称。

value

string

非机密环境变量值。

Error

错误模型。

名称 类型 说明
code

string

标准化字符串,以编程方式标识错误。

details

Details[]

详细信息或错误

innererror

string

调试错误的详细信息。

message

string

详细的错误说明和调试信息。

target

string

详细的错误说明和调试信息。

EventTriggerConfig

触发事件驱动作业的配置。

名称 类型 说明
parallelism

integer (int32)

可在给定时间运行的作业的并行副本数。

replicaCompletionCount

integer (int32)

在完成整个作业之前,副本成功完成的最小数目。

scale

JobScale

缩放事件驱动作业的配置。

HttpGet

HTTPGet 指定要执行的 http 请求。

名称 类型 说明
host

string

要连接的主机名,默认为 Pod IP。 你可能想要改为在 httpHeaders 中设置“主机”。

httpHeaders

HttpHeaders[]

在请求中设置的自定义标头。 HTTP 允许重复标头。

path

string

在 HTTP 服务器上访问的路径。

port

integer (int32)

要在容器上访问的端口的名称或编号。 数字必须介于 1 到 65535 的范围内。 名称必须是IANA_SVC_NAME。

scheme

Scheme

用于连接到主机的方案。 默认为 HTTP。

HttpHeaders

在请求中设置的自定义标头。 HTTP 允许重复标头。

名称 类型 说明
name

string

标头字段名称

value

string

标头字段值

IdentitySettings

分配给容器应用的托管标识的可选设置。

名称 类型 默认值 说明
identity

string

分配给容器应用的用户分配托管标识的资源 ID,或系统分配的标识的“系统”。

lifecycle

IdentitySettingsLifeCycle

All

用于选择容器应用的生命周期阶段,在此期间应提供托管标识。

IdentitySettingsLifeCycle

用于选择容器应用的生命周期阶段,在此期间应提供托管标识。

说明
All
Init
Main
None

InitContainer

容器应用 init 容器定义

名称 类型 说明
args

string[]

容器启动命令参数。

command

string[]

容器启动命令。

env

EnvironmentVar[]

容器环境变量。

image

string

容器映像标记。

name

string

自定义容器名称。

resources

ContainerResources

容器资源要求。

volumeMounts

VolumeMount[]

容器卷装载。

Job

容器应用作业

名称 类型 说明
id

string (arm-id)

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

identity

ManagedServiceIdentity

容器应用作业需要托管标识才能与其他 Azure 服务交互,以不维护代码中的任何机密或凭据。

location

string

资源所在的地理位置

name

string

资源的名称

properties.configuration

JobConfiguration

容器应用作业配置属性。

properties.environmentId

string

环境的资源 ID。

properties.eventStreamEndpoint

string

容器应用作业的事件流的终结点。

properties.outboundIpAddresses

string[]

容器应用作业的出站 IP 地址。

properties.provisioningState

JobProvisioningState

容器应用作业的预配状态。

properties.template

JobTemplate

容器应用作业定义。

properties.workloadProfileName

string

用于固定容器应用作业执行的工作负荷配置文件名称。

systemData

systemData

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

tags

object

资源标记。

type

string

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

JobConfiguration

非版本控制容器应用作业配置属性

名称 类型 默认值 说明
eventTriggerConfig

EventTriggerConfig

触发事件驱动作业的配置。

identitySettings

IdentitySettings[]

分配给容器应用作业的托管标识的可选设置。 如果未在此处指定托管标识,将使用默认设置。

manualTriggerConfig

ManualTriggerConfig

单个执行作业的手动触发器配置。 属性 replicaCompletionCount 和并行度默认设置为 1

registries

RegistryCredentials[]

容器应用作业使用的专用容器注册表凭据的集合

replicaRetryLimit

integer (int32)

失败作业之前的最大重试次数。

replicaTimeout

integer (int32)

允许副本运行的最大秒数。

scheduleTriggerConfig

ScheduleTriggerConfig

Cron 格式化了 cronjobs 的重复触发器计划(“* * * *”)。 默认情况下,属性完成和并行度设置为 1

secrets

Secret[]

容器应用作业使用的机密集合

triggerType

TriggerType

Manual

作业的触发器类型

JobProvisioningState

容器应用作业的预配状态。

说明
Canceled
Deleting
Failed
InProgress
Succeeded

JobScale

缩放事件驱动作业的配置。

名称 类型 默认值 说明
maxExecutions

integer (int32)

100

为触发器创建的最大作业执行次数,默认值为 100。

minExecutions

integer (int32)

0

为触发器创建的最小作业执行次数,默认为 0

pollingInterval

integer (int32)

检查每个事件源的间隔(以秒为单位)。 默认值为 30s

rules

JobScaleRule[]

缩放规则。

JobScaleRule

缩放规则。

名称 类型 说明
auth

ScaleRuleAuth[]

缩放规则的身份验证机密。

identity

string

分配给容器应用的用户分配托管标识的资源 ID,或系统分配的标识的“系统”。

metadata

object

描述缩放规则的元数据属性。

name

string

缩放规则名称

type

string

缩放规则的类型,例如:azure-servicebus、redis 等。

JobTemplate

容器应用作业版本控制的应用程序定义。 定义不可变修订的所需状态。 对本部分所做的任何更改都将导致创建新的修订

名称 类型 说明
containers

Container[]

容器应用的容器定义列表。

initContainers

InitContainer[]

在应用容器之前运行的专用容器列表。

volumes

Volume[]

容器应用的卷定义列表。

ManagedServiceIdentity

托管服务标识(系统分配和/或用户分配的标识)

名称 类型 说明
principalId

string (uuid)

系统分配标识的服务主体 ID。 此属性仅针对系统分配的标识提供。

tenantId

string (uuid)

系统分配标识的租户 ID。 此属性仅针对系统分配的标识提供。

type

ManagedServiceIdentityType

托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。

userAssignedIdentities

<string,  UserAssignedIdentity>

User-Assigned 标识
与资源关联的用户分配标识集。 userAssignedIdentities 字典密钥将为 ARM 资源 ID,格式为“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 字典值可以是请求中的空对象({})。

ManagedServiceIdentityType

托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。

说明
None
SystemAssigned
SystemAssigned,UserAssigned
UserAssigned

ManualTriggerConfig

单个执行作业的手动触发器配置。 属性 replicaCompletionCount 和并行度默认设置为 1

名称 类型 说明
parallelism

integer (int32)

可在给定时间运行的作业的并行副本数。

replicaCompletionCount

integer (int32)

在完成整个作业之前,副本成功完成的最小数目。

RegistryCredentials

容器应用专用注册表

名称 类型 说明
identity

string

用于通过 Azure 容器注册表进行身份验证的托管标识。 对于用户分配的标识,请使用完整的用户分配标识资源 ID。 对于系统分配的标识,请使用“system”

passwordSecretRef

string

包含注册表登录密码的机密的名称

server

string

容器注册表服务器

username

string

容器注册表用户名

ScaleRuleAuth

缩放规则的身份验证机密

名称 类型 说明
secretRef

string

要从中提取身份验证参数的机密的名称。

triggerParameter

string

使用机密的触发器参数

ScheduleTriggerConfig

Cron 格式化了 cronjobs 的重复触发器计划(“* * * *”)。 默认情况下,属性完成和并行度设置为 1

名称 类型 说明
cronExpression

string

Cron 格式化了 Cron 作业的重复计划(“* * * *”)。

parallelism

integer (int32)

可在给定时间运行的作业的并行副本数。

replicaCompletionCount

integer (int32)

在完成整个作业之前,副本成功完成的最小数目。

Scheme

用于连接到主机的方案。 默认为 HTTP。

说明
HTTP
HTTPS

Secret

机密定义。

名称 类型 说明
identity

string

使用 Azure Key Vault 进行身份验证的托管标识的资源 ID,或使用系统分配的标识。

keyVaultUrl

string

指向容器应用引用的机密的 Azure Key Vault URL。

name

string

机密名称。

value

string

机密值。

SecretVolumeItem

要添加到卷的机密。

名称 类型 说明
path

string

项目机密的路径。 如果未提供路径,则路径默认为 secretRef 中列出的机密的名称。

secretRef

string

要从中拉取机密值的容器应用机密的名称。

StorageType

卷的存储类型。 如果未提供,请使用 EmptyDir。

说明
AzureFile
EmptyDir
NfsAzureFile
Secret

systemData

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

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

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

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

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

TcpSocket

TCPSocket 指定涉及 TCP 端口的操作。 尚不支持 TCP 挂钩。

名称 类型 说明
host

string

可选:要连接到的主机名,默认为 Pod IP。

port

integer (int32)

要在容器上访问的端口的编号或名称。 数字必须介于 1 到 65535 的范围内。 名称必须是IANA_SVC_NAME。

TriggerType

作业的触发器类型

说明
Event
Manual
Schedule

Type

探测的类型。

说明
Liveness
Readiness
Startup

UserAssignedIdentity

用户分配的标识属性

名称 类型 说明
clientId

string (uuid)

分配的标识的客户端 ID。

principalId

string (uuid)

已分配标识的主体 ID。

Volume

容器应用的卷定义。

名称 类型 说明
mountOptions

string

装载 Azure 文件共享或 NFS Azure 文件共享时使用的装载选项。 必须是逗号分隔的字符串。

name

string

卷名称。

secrets

SecretVolumeItem[]

要添加到卷中的机密列表。 如果未提供机密,集合中的所有机密都将添加到卷中。

storageName

string

存储资源的名称。 无需提供 EmptyDir 和 Secret。

storageType

StorageType

卷的存储类型。 如果未提供,请使用 EmptyDir。

VolumeMount

容器应用的卷装载。

名称 类型 说明
mountPath

string

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

subPath

string

应从中装载容器卷的卷中的路径。 默认为“”(卷的根目录)。

volumeName

string

这必须与卷的名称匹配。