徵兆
使用 Microsoft Playwright 測試時,您無法登入 Playwright 入口網站。 您收到下列錯誤訊息:
AADSTS7000112:應用程式 'b1fd4ebf-2bed-4162-be84-97e0fe523f64'(PlaywrightServiceAADLogin) 已停用。
原因
如果租使用者停用 Microsoft Playwright Testing 的服務主體,就會發生此問題。
解決方法
若要解決此問題,您必須為租用戶啟用 Microsoft Playwright Testing 的服務主體。
重要
若要啟用服務主體,您必須是租用戶系統管理員。
請遵循下列步驟來啟用Microsoft Playwright Testing 服務主體:
開啟提升許可權的 Windows PowerShell 命令提示字元(以系統管理員身分執行 Windows PowerShell)。
執行下列 Cmdlet,以安裝適用於 Windows PowerShell 的 azure Active Directory 模組Microsoft:
Install-Module MSOnline
執行下列 Cmdlet,連線到您Microsoft 365 訂閱的 Microsoft Entra 識別符:
Connect-MsolService
執行下列 Cmdlet,檢查服務主體的目前狀態,以Microsoft Playwright Testing:
(Get-MsolServicePrincipal -AppPrincipalId b1fd4ebf-2bed-4162-be84-97e0fe523f64).accountenabled
執行下列 Cmdlet,啟用Microsoft Playwright Testing 的服務主體:
Get-MsolServicePrincipal -AppPrincipalId b1fd4ebf-2bed-4162-be84-97e0fe523f64 | Set-MsolServicePrincipal -AccountEnabled $true