az container
Note
此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。
管理 Azure 容器執行個體。
命令
| 名稱 | Description | 類型 | 狀態 |
|---|---|---|---|
| az container app |
管理 Azure 容器實例應用程式的命令。 |
Extension | Preview |
| az container app up |
使用 GitHub Actions 部署至 Azure 容器實例。 |
Extension | Preview |
| az container attach |
將本機標準輸出和錯誤數據流附加至容器群組中的容器。 此命令會在容器啟動期間提供診斷資訊。 容器啟動之後,它會將 STDOUT 和 STDERR 串流至本機控制台。 |
Core | GA |
| az container container-group-profile |
管理 Azure 容器實例容器群組配置檔。 |
Core | GA |
| az container container-group-profile create |
建立容器群組配置檔。 |
Core | GA |
| az container container-group-profile delete |
刪除容器群組配置檔。 |
Core | GA |
| az container container-group-profile list |
列出資源群組中的所有容器群組配置檔。 |
Core | GA |
| az container container-group-profile list-revisions |
列出容器群組配置檔的所有修訂。 |
Core | GA |
| az container container-group-profile show |
取得容器群組配置檔。 |
Core | GA |
| az container container-group-profile show-revision |
顯示容器群組配置檔修訂。 |
Core | GA |
| az container create |
建立容器群組。 |
Core | GA |
| az container delete |
刪除容器群組。 |
Core | GA |
| az container exec |
從容器群組的執行中容器內執行命令。 |
Core | GA |
| az container export |
以 yaml 格式匯出容器群組。 |
Core | GA |
| az container list |
列出容器群組。 |
Core | GA |
| az container logs |
檢查容器群組中容器的記錄。 |
Core | GA |
| az container restart |
重新啟動容器群組中的所有容器。 |
Core | GA |
| az container show |
取得容器群組的詳細數據。 |
Core | GA |
| az container start |
啟動容器群組中的所有容器。 |
Core | GA |
| az container stop |
停止容器群組中的所有容器。 |
Core | GA |
az container attach
將本機標準輸出和錯誤數據流附加至容器群組中的容器。 此命令會在容器啟動期間提供診斷資訊。 容器啟動之後,它會將 STDOUT 和 STDERR 串流至本機控制台。
az container attach [--container-name]
[--ids]
[--name]
[--resource-group]
[--subscription]
範例
將本機標準輸出和錯誤數據流附加至容器群組中的容器。 (autogenerated)
az container attach --name MyContainerGroup --resource-group MyResourceGroup
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
要附加的容器。 如果省略,則會選擇容器群組中的第一個容器。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
容器群組的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container create
建立容器群組。
az container create --resource-group
[--acr-identity]
[--add-capabilities]
[--allow-escalation]
[--assign-identity]
[--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]
[--container-group-profile-id]
[--container-group-profile-revision]
[--cpu]
[--dns-name-label]
[--drop-capabilities]
[--environment-variables]
[--fail-container-group-create-on-reuse-failure]
[--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}]
[--role]
[--run-as-group]
[--run-as-user]
[--scope]
[--seccomp-profile]
[--secrets]
[--secrets-mount-path]
[--secure-environment-variables]
[--sku]
[--standby-pool-profile-id]
[--subnet]
[--subnet-address-prefix]
[--vnet]
[--vnet-address-prefix]
[--zone]
範例
在具有 1 核心和 1Gb 記憶體的容器群組中建立容器。
az container create -g MyResourceGroup --name myapp --image myimage:latest --cpu 1 --memory 1
在執行 Windows 的容器群組中建立容器,其中包含 2 個核心和 3.5Gb 的記憶體。
az container create -g MyResourceGroup --name mywinapp --image winappimage:latest --os-type Windows --cpu 2 --memory 3.5
在具有公用IP位址、埠和 DNS 名稱標籤的容器群組中建立容器。
az container create -g MyResourceGroup --name myapp --image myimage:latest --ports 80 443 --dns-name-label contoso
在容器群組中建立容器,以在啟動時叫用腳本。
az container create -g MyResourceGroup --name myapp --image myimage:latest --command-line "/bin/sh -c '/path to/myscript.sh'"
在容器群組中建立容器,以執行命令,並在之後停止容器。
az container create -g MyResourceGroup --name myapp --image myimage:latest --command-line "echo hello" --restart-policy Never
使用環境變數在容器群組中建立容器。
az container create -g MyResourceGroup --name myapp --image myimage:latest --environment-variables key1=value1 key2=value2
使用 Azure Container Registry 中的容器映射,在容器群組中建立容器。
az container create -g MyResourceGroup --name myapp --image myAcrRegistry.azurecr.io/myimage:latest --registry-password password
在將 Azure 檔案共用掛接為磁碟區的容器群組中建立容器。
az container create -g MyResourceGroup --name myapp --image myimage:latest --command-line "cat /mnt/azfile/myfile" --azure-file-volume-share-name myshare --azure-file-volume-account-name mystorageaccount --azure-file-volume-account-key mystoragekey --azure-file-volume-mount-path /mnt/azfile
在容器群組中建立容器,以將 Git 存放庫掛接為磁碟區。
az container create -g MyResourceGroup --name myapp --image myimage:latest --command-line "cat /mnt/gitrepo" --gitrepo-url https://github.com/user/myrepo.git --gitrepo-dir ./dir1 --gitrepo-mount-path /mnt/gitrepo
使用 yaml 檔案在容器群組中建立容器。
az container create -g MyResourceGroup -f containerGroup.yaml
從工作區名稱使用Log Analytics建立容器群組。
az container create -g MyResourceGroup --name myapp --log-analytics-workspace myworkspace
建立具有系統指派身分識別的容器群組。
az container create -g MyResourceGroup --name myapp --image myimage:latest --assign-identity
建立具有系統指派身分識別的容器群組。 群組將具有記憶體帳戶存取權的「參與者」角色。
az container create -g MyResourceGroup --name myapp --image myimage:latest --assign-identity --scope /subscriptions/99999999-1bf0-4dda-aec3-cb9272f09590/MyResourceGroup/myRG/providers/Microsoft.Storage/storageAccounts/storage1
建立具有使用者指派身分識別的容器群組。
az container create -g MyResourceGroup --name myapp --image myimage:latest --assign-identity /subscriptions/mySubscriptionId/resourcegroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myID
建立同時具有系統和使用者指派身分識別的容器群組。
az container create -g MyResourceGroup --name myapp --image myimage:latest --assign-identity [system] /subscriptions/mySubscriptionId/resourcegroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myID
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
具有容器登錄存取權的身分識別。
| 屬性 | 值 |
|---|---|
| 參數群組: | Image Registry Arguments |
要新增的安全性內容功能清單。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
允許進程是否可取得比其父進程更多的許可權。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
| 預設值: | False |
以空格分隔的指派身分識別清單。 指派的身分識別是使用者指派的身分識別(資源標識符)和/或系統指派的身分識別('[system]')。 如需詳細資訊,請參閱範例。
| 屬性 | 值 |
|---|---|
| 參數群組: | Managed Service Identity Arguments |
用來存取 Azure 檔案共用的記憶體帳戶存取金鑰。
| 屬性 | 值 |
|---|---|
| 參數群組: | Azure File Volume Arguments |
包含 Azure 檔案共用的記憶體帳戶名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Azure File Volume Arguments |
容器內應掛接 Azure 檔案磁碟區的路徑。 不得包含冒號 『:』。
| 屬性 | 值 |
|---|---|
| 參數群組: | Azure File Volume Arguments |
要掛接為磁碟區的 Azure 檔案共享名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Azure File Volume Arguments |
機密容器群組的 CCE 原則。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
啟動容器時要執行的命令行,例如 '/bin/bash -c myscript.sh'。
容器的組態對應索引鍵/值組清單。 以 『key=value』 格式分隔的空間值。
參考容器群組配置檔 ARM 資源識別碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Container Group Profile Reference Arguments |
參考容器群組配置檔修訂。
| 屬性 | 值 |
|---|---|
| 參數群組: | Container Group Profile Reference Arguments |
容器所需的 CPU 核心數目,精確到一個小數位數。
具有公用IP之容器群組的 DNS 名稱標籤。
要卸除的安全性內容功能清單。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
容器的環境變數清單。 以 『key=value』 格式分隔的空間值。
指出如果待命集區重複使用失敗,容器群組建立是否失敗的旗標。
| 屬性 | 值 |
|---|---|
| 參數群組: | Standby Pool Profile Arguments |
| 預設值: | False |
輸入檔的路徑。
Git 存放庫中的目標目錄路徑。 不得包含 『..』。
| 屬性 | 值 |
|---|---|
| 參數群組: | Git Repo Volume Arguments |
| 預設值: | . |
容器內應該掛接 git 存放庫磁碟區的路徑。 不得包含冒號 『:』。
| 屬性 | 值 |
|---|---|
| 參數群組: | Git Repo Volume Arguments |
指定修訂的認可哈希。
| 屬性 | 值 |
|---|---|
| 參數群組: | Git Repo Volume Arguments |
要掛接為磁碟區的 Git 存放庫 URL。
| 屬性 | 值 |
|---|---|
| 參數群組: | Git Repo Volume Arguments |
容器映像名稱。
容器群組的IP位址類型。
| 屬性 | 值 |
|---|---|
| 接受的值: | Private, Public |
Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。
Log Analytics 工作區名稱或標識碼。使用目前的訂用帳戶或使用 --subscription 旗標來設定所需的訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Log Analytics Arguments |
Log Analytics 工作區密鑰。
| 屬性 | 值 |
|---|---|
| 參數群組: | Log Analytics Arguments |
GB 中容器的必要記憶體,精確到一個小數字數。
容器群組的名稱。
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
容器的 OS 類型。
| 屬性 | 值 |
|---|---|
| 接受的值: | Linux, Windows |
要開啟的埠清單。 以空格分隔的埠清單。
| 屬性 | 值 |
|---|---|
| 預設值: | [80] |
容器群組的優先順序。
用來判斷容器許可權是否提升為 Privileged 的旗標。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
| 預設值: | False |
要使用的網路通訊協定。
| 屬性 | 值 |
|---|---|
| 接受的值: | TCP, UDP |
容器映像登錄登入伺服器。
| 屬性 | 值 |
|---|---|
| 參數群組: | Image Registry Arguments |
用來登入容器映像登錄伺服器的密碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Image Registry Arguments |
用來登入容器映像登錄伺服器的用戶名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Image Registry Arguments |
重新啟動容器群組內所有容器的原則。
| 屬性 | 值 |
|---|---|
| 接受的值: | Always, Never, OnFailure |
系統指派身分識別的角色名稱或標識碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Managed Service Identity Arguments |
| 預設值: | Contributor |
設定容器的使用者 UID。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
設定容器的使用者 GID。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
系統指派的身分識別可以存取的範圍。
| 屬性 | 值 |
|---|---|
| 參數群組: | Managed Service Identity Arguments |
base64 編碼字串,其中包含 seccomp 配置檔中 JSON 的內容。
| 屬性 | 值 |
|---|---|
| 參數群組: | Confidential Container Group Arguments |
以 『key=value』 格式分隔的空間秘密。
容器內應掛接秘密磁碟區的路徑。 不得包含冒號 『:』。
容器的安全環境變數清單。 以 『key=value』 格式分隔的空間值。
容器群組的 SKU。
待命集區配置檔 ARM 資源識別碼,容器會從中重複使用。
| 屬性 | 值 |
|---|---|
| 參數群組: | Standby Pool Profile Arguments |
建立新的 VNET 或參考現有 VNET 時,子網的名稱。 也可以依標識碼參考現有的子網。
| 屬性 | 值 |
|---|---|
| 參數群組: | Network Arguments |
建立 CIDR 格式的新 VNET 時要使用的子網 IP 位址前綴。
| 屬性 | 值 |
|---|---|
| 參數群組: | Network Arguments |
| 預設值: | 10.0.0.0/24 |
建立新的 VNET 或參考現有 VNET 時的名稱。 也可以依標識碼參考現有的 vnet。 這允許使用來自其他資源群組的 vnet。
| 屬性 | 值 |
|---|---|
| 參數群組: | Network Arguments |
以 CIDR 格式建立新 VNET 時要使用的 IP 位址前置綴。
| 屬性 | 值 |
|---|---|
| 參數群組: | Network Arguments |
| 預設值: | 10.0.0.0/16 |
要放置容器群組的區域。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container delete
刪除容器群組。
az container delete [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
範例
刪除容器群組。 (autogenerated)
az container delete --name MyContainerGroup --resource-group MyResourceGroup
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
容器群組的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container exec
從容器群組的執行中容器內執行命令。
最常見的使用案例是開啟互動式Bash殼層。 請參閱下列範例。
az container exec --exec-command
[--container-name]
[--ids]
[--name]
[--resource-group]
[--subscription]
範例
從 nginx 容器內串流殼層。
az container exec -g MyResourceGroup --name mynginx --container-name nginx --exec-command "/bin/bash"
必要參數
要從容器內執行的命令。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
要在其中執行命令的容器名稱。 只有一個容器的容器群組可以省略。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
容器群組的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container export
以 yaml 格式匯出容器群組。
az container export --file
[--ids]
[--name]
[--resource-group]
[--subscription]
範例
在 yaml 中匯出容器群組。
az container export -g MyResourceGroup --name mynginx -f output.yaml
必要參數
匯出容器群組的檔案路徑。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
容器群組的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container list
列出容器群組。
az container list [--resource-group]
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container logs
檢查容器群組中容器的記錄。
az container logs [--container-name]
[--follow]
[--ids]
[--name]
[--resource-group]
[--subscription]
範例
檢查容器群組中容器的記錄。 (autogenerated)
az container logs --name MyContainerGroup --resource-group MyResourceGroup
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
要尾端記錄的容器名稱。 如果省略,則會選擇容器群組中的第一個容器。
指示串流尾日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
容器群組的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container restart
重新啟動容器群組中的所有容器。
重新啟動容器群組中的所有容器。 如果容器映像有更新,將會下載新的映像。
az container restart --name
--resource-group
[--no-wait]
必要參數
容器群組的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container show
取得容器群組的詳細數據。
az container show [--ids]
[--name]
[--resource-group]
[--subscription]
範例
取得容器群組的詳細數據。 (autogenerated)
az container show --name MyContainerGroup --resource-group MyResourceGroup
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
容器群組的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container start
啟動容器群組中的所有容器。
啟動容器群組中的所有容器。 將會配置計算資源,並開始計費。
az container start --name
--resource-group
[--no-wait]
必要參數
容器群組的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az container stop
停止容器群組中的所有容器。
停止容器群組中的所有容器。 計算資源將會解除分配,計費將會停止。
az container stop --name
--resource-group
必要參數
容器群組的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |