Share via


az containerapp secret

管理秘密的命令。

命令

名稱 Description 類型 狀態
az containerapp secret list

列出容器應用程式的秘密。

核心 GA
az containerapp secret remove

從容器應用程式移除秘密。

核心 GA
az containerapp secret set

建立/更新秘密。

核心 GA
az containerapp secret show

顯示秘密的詳細數據。

核心 GA

az containerapp secret list

列出容器應用程式的秘密。

az containerapp secret list --name
                            --resource-group
                            [--show-values]

範例

列出容器應用程式的秘密。

az containerapp secret list -n my-containerapp -g MyResourceGroup

必要參數

--name -n

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

--resource-group -g

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

選擇性參數

--show-values

顯示秘密值。

預設值: False
全域參數
--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 secret remove

從容器應用程式移除秘密。

az containerapp secret remove --secret-names
                              [--ids]
                              [--name]
                              [--resource-group]
                              [--subscription]

範例

從容器應用程式移除秘密。

az containerapp secret remove -n my-containerapp -g MyResourceGroup --secret-names MySecret MySecret2

必要參數

--secret-names

容器應用程式的秘密清單。 以空格分隔的秘密值名稱。

選擇性參數

--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 來取得完整偵錯記錄。

az containerapp secret set

建立/更新秘密。

az containerapp secret set --secrets
                           [--ids]
                           [--name]
                           [--resource-group]
                           [--subscription]

範例

將秘密新增至容器應用程式。

az containerapp secret set -n my-containerapp -g MyResourceGroup --secrets MySecretName1=MySecretValue1 MySecretName2=keyvaultref:https://example.vault.azure.net/secrets/mysecret,identityref:/subscriptions/sub/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity

更新秘密。

az containerapp secret set -n my-containerapp -g MyResourceGroup --secrets MyExistingSecretName=MyNewSecretValue MyExistingSecretName2=keyvaultref:https://example.vault.azure.net/secrets/mysecret,identityref:/subscriptions/sub/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity

必要參數

--secrets -s

容器應用程式的秘密清單。 'key=value' 或 'key=keyvaultref:keyvaulturl,identityref:identityref'格式的空間分隔值(其中 'key' 不能超過 20 個字符)。

選擇性參數

--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 來取得完整偵錯記錄。

az containerapp secret show

顯示秘密的詳細數據。

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

範例

顯示秘密的詳細數據。

az containerapp secret show -n my-containerapp -g MyResourceGroup --secret-name MySecret

必要參數

--secret-name

要顯示的秘密名稱。

選擇性參數

--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 來取得完整偵錯記錄。