由于描述错误,无法从 PowerShell 连接 Azure 帐户。
PS C:\WINDOWS\system32> Connect-AzAccount
WARNING: Unable to acquire token for tenant '36ff3f25-cbe8-48b8-ba26-58974869160e'
WARNING: Unable to set default context 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureContext'.
Connect-AzAccount : Run Connect-AzAccount to login.
At line:1 char:1
+ Connect-AzAccount
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Connect-AzAccount], PSInvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
如何解决这个问题?
我遇到过类似的错误消息
Connect-AzAccount -环境 AzureChinaCloud
WARNING: Unable to acquire token for tenant 'xxxxxxxxxxxxxxxxxxxx' with error 'SharedTokenCacheCredential authentication unavailable. No account matching the specified username: [email protected] tenantId: xxxxxxxxxxxxxxxxxxxx was found in the cache.'
WARNING: Unable to set default context 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureContext'
Jason的回复给了我提示。我已经清理了缓存文件,它可以正常工作。
这是我做的
现在,VScode 终端让我登录。
希望能帮到你。