az webapp auth-classic

注意

此參考是 Azure CLI 的 authV2 延伸模組的一部分 (2.23.0 版或更高版本)。 擴充功能會在您第一次執行 az webapp auth-classic 命令時自動安裝。 深入了解擴充功能。

以傳統格式管理 Webapp 驗證和授權。

命令

名稱 Description 類型 狀態
az webapp auth-classic show

以傳統格式顯示 Webapp 的驗證設定。

副檔名 GA
az webapp auth-classic update

以傳統格式更新 Webapp 的驗證設定。

副檔名 GA

az webapp auth-classic show

以傳統格式顯示 Webapp 的驗證設定。

az webapp auth-classic show [--ids]
                            [--name]
                            [--resource-group]
                            [--slot]
                            [--subscription]

範例

顯示 Webapp 的驗證設定。 (自動產生)

az webapp auth-classic show --name MyWebApp --resource-group MyResourceGroup

選擇性參數

--ids

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

--name -n

Web 應用程式的名稱。

--resource-group -g

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

--slot -s

位置的名稱。 如果未指定,則預設為生產位置。

--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 webapp auth-classic update

以傳統格式更新 Webapp 的驗證設定。

請注意,驗證設定不會再傳回為結果。 請使用 az webapp auth-classic show 命令來檢視設定值。

az webapp auth-classic update [--aad-allowed-token-audiences]
                              [--aad-client-id]
                              [--aad-client-secret]
                              [--aad-client-secret-certificate-thumbprint]
                              [--aad-client-secret-setting-name]
                              [--aad-token-issuer-url]
                              [--action {AllowAnonymous, LoginWithAzureActiveDirectory, LoginWithFacebook, LoginWithGoogle, LoginWithMicrosoftAccount, LoginWithTwitter}]
                              [--allowed-redirect-urls]
                              [--enabled {false, true}]
                              [--facebook-app-id]
                              [--facebook-app-secret]
                              [--facebook-app-secret-setting-name]
                              [--facebook-oauth-scopes]
                              [--github-client-id]
                              [--github-client-secret]
                              [--github-client-secret-setting-name]
                              [--github-oauth-scopes]
                              [--google-client-id]
                              [--google-client-secret]
                              [--google-client-secret-setting-name]
                              [--google-oauth-scopes]
                              [--ids]
                              [--microsoft-account-client-id]
                              [--microsoft-account-client-secret]
                              [--microsoft-account-client-secret-setting-name]
                              [--microsoft-account-oauth-scopes]
                              [--name]
                              [--resource-group]
                              [--runtime-version]
                              [--slot]
                              [--subscription]
                              [--token-refresh-extension-hours]
                              [--token-store {false, true}]
                              [--twitter-consumer-key]
                              [--twitter-consumer-secret]
                              [--twitter-consumer-secret-setting-name]

範例

啟用驗證並設定 Azure Active Directory 相關參數,以啟用 Azure Active Directory。 預設提供者設定為 AAD。 必須事先建立 AAD 服務主體。

az webapp auth-classic update  -g myResourceGroup --name MyWebApp --enabled true \
  --action LoginWithAzureActiveDirectory \
  --aad-allowed-token-audiences https://webapp_name.azurewebsites.net/.auth/login/aad/callback \
  --aad-client-id my-client-id --aad-client-secret very_secret_password \
  --aad-token-issuer-url https://sts.windows.net/54826b22-38d6-4fb2-bad9-b7983a3e9c5a/

設定 FB 相關聯的參數並開啟公用設定檔和電子郵件範圍,以啟用 Facebook 驗證;允許匿名使用者

az webapp auth-classic update -g myResourceGroup --name MyWebApp --action AllowAnonymous \
  --facebook-app-id my_fb_id --facebook-app-secret my_fb_secret \
  --facebook-oauth-scopes public_profile email

選擇性參數

--aad-allowed-token-audiences --allowed-audiences

一或多個權杖物件(以空格分隔)。

--aad-client-id

將 AAD 組織帳戶登入整合到 Web 應用程式的應用程式識別碼。

--aad-client-secret

AAD 應用程式秘密。

--aad-client-secret-certificate-thumbprint --thumbprint

替代 AAD 用戶端密碼,用於簽署目的的憑證指紋。

--aad-client-secret-setting-name --aad-secret-setting

包含信賴憑證者應用程式用戶端密碼的應用程式設定名稱。

--aad-token-issuer-url

您可以在使用 tenantID 從 Active Directory 端點傳回的 JSON 輸出中找到此 URL。 您可以從 az cloud show 「endpoints.activeDirectory」 查詢端點。 您可以使用 az account show 找到 tenantID。 從 JSON 取得位於 //.known/openid-configuration 的「簽發者」。

--action

當未經驗證的用戶端嘗試存取應用程式時要採取的動作。

接受的值: AllowAnonymous, LoginWithAzureActiveDirectory, LoginWithFacebook, LoginWithGoogle, LoginWithMicrosoftAccount, LoginWithTwitter
--allowed-redirect-urls

一或多個 URL(空格分隔)。

--enabled

如果目前應用程式已啟用驗證/授權功能,則為 True;否則為 false。

接受的值: false, true
--facebook-app-id

將 Facebook 登入整合到 Web 應用程式的應用程式識別碼。

--facebook-app-secret

Facebook 應用程式用戶端密碼。

--facebook-app-secret-setting-name --fb-secret-setting

應用程式設定名稱,其中包含用於 Facebook 登入的應用程式密碼。

--facebook-oauth-scopes

一或多個 facebook 驗證範圍(以空格分隔)。

--github-client-id

用於登入的 GitHub 應用程式的用戶端識別碼。

--github-client-secret

用於登入的 GitHub 應用程式的用戶端密碼。

--github-client-secret-setting-name --github-secret-setting

應用程式設定名稱,其中包含用於 GitHub 登入之 Github 應用程式的用戶端密碼。

--github-oauth-scopes --github-scopes

將作為 GitHub 登入驗證一部分要求的 OAuth 2.0 範圍。

--google-client-id

將 Google 登入整合到 Web 應用程式的應用程式識別碼。

--google-client-secret

Google Application 用戶端密碼。

--google-client-secret-setting-name --google-secret-setting

應用程式設定名稱,其中包含與 Google Web 應用程式相關聯的用戶端密碼。

--google-oauth-scopes

一或多個 Google 驗證範圍(以空格分隔)。

--ids

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

--microsoft-account-client-id --msa-client

AAD V2 應用程式識別碼,可將 Microsoft 帳戶登入整合到 Web 應用程式中。

--microsoft-account-client-secret --msa-secret

AAD V2 應用程式用戶端密碼。

--microsoft-account-client-secret-setting-name --msa-secret-setting

應用程式設定名稱,其中包含針對用於驗證的應用程式所建立的 OAuth 2.0 用戶端密碼。

--microsoft-account-oauth-scopes --msa-scopes

一或多個 Microsoft 驗證範圍(空格分隔)。

--name -n

Web 應用程式的名稱。

--resource-group -g

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

--runtime-version

用於目前應用程式的驗證/授權功能的執行時間版本。

--slot -s

位置的名稱。 如果未指定,則預設為生產位置。

--subscription

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

--token-refresh-extension-hours --token-refresh-hours

小時,必須可格式化為浮點數。

--token-store

使用 App Service 權杖存放區。

接受的值: false, true
--twitter-consumer-key

將 Twitter 登入整合到 Web 應用程式的應用程式識別碼。

--twitter-consumer-secret --twitter-secret

Twitter 應用程式用戶端密碼。

--twitter-consumer-secret-setting-name --twitter-secret-setting

應用程式設定名稱,其中包含用於登入之 Twitter 應用程式的 OAuth 1.0a 取用者密碼。

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