Jobs - Start
啟動容器應用程式作業
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start?api-version=2026-07-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
job
|
path | True |
string pattern: ^[-\w\._\(\)]+$ |
作業名稱 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| containers |
Container Apps 作業的容器定義清單。 |
|
| initContainers |
在工作容器之前執行的特製化容器清單。 |
回覆
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
Azure 作業已順利完成。 |
|
| 202 Accepted |
已接受資源作業。 標題
|
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 冒用您的使用者帳戶 |
範例
Run a Container Apps Job
範例要求
POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0/start?api-version=2026-07-01
{
"containers": [
{
"name": "testcontainerAppsJob0",
"image": "repo/testcontainerAppsJob0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
],
"initContainers": [
{
"name": "testinitcontainerAppsJob0",
"args": [
"-c",
"while true; do echo hello; sleep 10;done"
],
"command": [
"/bin/sh"
],
"image": "repo/testcontainerAppsJob0:v4",
"resources": {
"cpu": 0.2,
"memory": "100Mi"
}
}
]
}
範例回覆
{
"name": "testcontainerAppsJob0-pjxhsye",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/{containerAppsJobName}/executions/{jobExecutionName}"
}
Location: location
定義
| 名稱 | Description |
|---|---|
|
Container |
容器應用程式容器資源需求。 |
|
Default |
App Service 錯誤回應。 |
|
Default |
錯誤模型。 |
|
Default |
詳細的錯誤。 |
|
Environment |
容器應用程式容器環境變數。 |
|
Job |
容器應用程式的作業執行名稱。 |
|
Job |
容器應用程式作業執行容器定義。 |
|
Job |
作業的執行範本,包含作業執行的容器組態 |
ContainerResources
容器應用程式容器資源需求。
| 名稱 | 類型 | Description |
|---|---|---|
| cpu |
number (double) |
核心中所需的CPU,例如0.5 |
| ephemeralStorage |
string |
暫時儲存,例如「1Gi」 |
| memory |
string |
所需的記憶體,例如 “250Mb” |
DefaultErrorResponse
App Service 錯誤回應。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤模型。 |
DefaultErrorResponseError
錯誤模型。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
標準化字串,以程式設計方式識別錯誤。 |
| details |
詳細資料或錯誤 |
|
| innererror |
string |
偵錯錯誤的詳細資訊。 |
| message |
string |
詳細的錯誤描述和偵錯資訊。 |
| target |
string |
詳細的錯誤描述和偵錯資訊。 |
DefaultErrorResponseErrorDetailsItem
詳細的錯誤。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
標準化字串,以程式設計方式識別錯誤。 |
| message |
string |
詳細的錯誤描述和偵錯資訊。 |
| target |
string |
詳細的錯誤描述和偵錯資訊。 |
EnvironmentVar
容器應用程式容器環境變數。
| 名稱 | 類型 | Description |
|---|---|---|
| name |
string |
環境變數名稱。 |
| secretRef |
string |
要從中提取環境變數值的容器應用程式秘密名稱。 |
| value |
string |
非秘密環境變數值。 |
JobExecutionBase
容器應用程式的作業執行名稱。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
任務執行識別碼。 |
| name |
string |
作業執行名稱。 |
JobExecutionContainer
容器應用程式作業執行容器定義。
| 名稱 | 類型 | Description |
|---|---|---|
| args |
string[] |
容器啟動命令自變數。 |
| command |
string[] |
容器啟動命令。 |
| env |
容器環境變數。 |
|
| image |
string |
容器映像標記。 |
| name |
string |
自訂容器名稱。 |
| resources |
容器資源需求。 |
JobExecutionTemplate
作業的執行範本,包含作業執行的容器組態
| 名稱 | 類型 | Description |
|---|---|---|
| containers |
Container Apps 作業的容器定義清單。 |
|
| initContainers |
在工作容器之前執行的特製化容器清單。 |