Get-AzAccessToken 失败并出现错误“SharedTokenCacheCredential 身份验证不可用”

问题描述 投票:0回答:0

我正在尝试在 PowerShell 中获取访问令牌,以访问需要 Azure AD 身份验证的 Funciton 应用程序。

我正在运行以下命令:

Connect-AzAccount -Subscription <subscriptionID> -TenantId <tenantID>
Get-AzAccessToken -ResourceUrl "<resourceURL>"

结果报错如下:

Get-AzAccessToken : SharedTokenCacheCredential authentication unavailable. Token acquisition failed for user <username>. Ensure that you have authenticated with a developer tool that supports Azure single sign on.

我可以通过我的网络浏览器和 Postman 访问同一个应用程序,但我正在努力使用 PowerShell。

azure powershell azure-functions azure-powershell
© www.soinside.com 2019 - 2024. All rights reserved.