Share via


az containerapp identity

管理受控識別的命令。

命令

名稱 Description 類型 狀態
az containerapp identity assign

將受控識別指派給容器應用程式。

核心 GA
az containerapp identity remove

從容器應用程式移除受控識別。

核心 GA
az containerapp identity show

顯示容器應用程式的受控識別。

核心 GA

az containerapp identity assign

將受控識別指派給容器應用程式。

受控識別可以是使用者指派或系統指派。

az containerapp identity assign [--ids]
                                [--name]
                                [--no-wait]
                                [--resource-group]
                                [--subscription]
                                [--system-assigned]
                                [--user-assigned]

範例

指派系統身分識別。

az containerapp identity assign -n my-containerapp -g MyResourceGroup --system-assigned

指派使用者身分識別。

az containerapp identity assign -n my-containerapp -g MyResourceGroup --user-assigned myUserIdentityName

指派使用者身分識別(來自與 containerapp 不同的資源群組)。

az containerapp identity assign -n my-containerapp -g MyResourceGroup --user-assigned myUserIdentityResourceId

指派系統和使用者身分識別。

az containerapp identity assign -n my-containerapp -g MyResourceGroup --system-assigned --user-assigned myUserIdentityResourceId

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

Containerapp 的名稱。 名稱必須包含小寫英數位元或 '-'、以字母開頭、以英數位元結尾、不能有 '--' 且必須小於 32 個字元。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--system-assigned

布爾值,指出是否指派系統指派的身分識別。

預設值: False
--user-assigned

以空格分隔的使用者身分識別。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az containerapp identity remove

從容器應用程式移除受控識別。

az containerapp identity remove [--ids]
                                [--name]
                                [--no-wait]
                                [--resource-group]
                                [--subscription]
                                [--system-assigned]
                                [--user-assigned]

範例

拿掉系統身分識別。

az containerapp identity remove -n my-containerapp -g MyResourceGroup --system-assigned

拿掉使用者身分識別。

az containerapp identity remove -n my-containerapp -g MyResourceGroup --user-assigned myUserIdentityName

從與 containerapp 不同的資源群組中移除系統和使用者身分識別。

az containerapp identity remove -n my-containerapp -g MyResourceGroup --system-assigned --user-assigned myUserIdentityResourceId

拿掉所有使用者身分識別。

az containerapp identity remove -n my-containerapp -g MyResourceGroup --user-assigned

拿掉系統身分識別和所有使用者身分識別。

az containerapp identity remove -n my-containerapp -g MyResourceGroup --system-assigned --user-assigned

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

Containerapp 的名稱。 名稱必須包含小寫英數位元或 '-'、以字母開頭、以英數位元結尾、不能有 '--' 且必須小於 32 個字元。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--system-assigned

布爾值,指出是否指派系統指派的身分識別。

預設值: False
--user-assigned

以空格分隔的使用者身分識別。 如果未指定任何使用者身分識別,將會移除所有使用者身分識別。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az containerapp identity show

顯示容器應用程式的受控識別。

az containerapp identity show [--ids]
                              [--name]
                              [--resource-group]
                              [--subscription]

範例

顯示受控識別。

az containerapp identity show -n my-containerapp -g MyResourceGroup

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

Containerapp 的名稱。 名稱必須包含小寫英數位元或 '-'、以字母開頭、以英數位元結尾、不能有 '--' 且必須小於 32 個字元。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。