Visual Studio 2022缓存了旧的租户ID,无法摆脱它。

huangapple go评论57阅读模式
英文:

Visual Studio 2022 caches old tenant id, can't get rid of it

问题

Visual Studio 在尝试使用集成的 Microsoft 身份验证平台工具登录 Azure 时选择了错误的租户 ID。它显示给我的 GUID 我并没有这样的,我的租户 ID GUID 对于该用户是不同的,错误消息中显示的用户名是正确的。我尝试在 Azure 门户中搜索它显示给我的 GUID(以 f8cd... 开头),但没有找到任何信息,不知道 Visual Studio 是从哪里获取的,可能是我很久以前使用过的一个旧的 GUID。

当我在命令提示符中键入 az account show 时,它显示了正确的用户和正确的租户 ID,与主租户 ID 匹配。

在 Visual Studio 设置中勾选/取消勾选框也没有帮助。

我尝试过重启 Visual Studio,重启 Windows,退出登录,重新登录,但都没有帮助。我还尝试清理 \AppData\Local\.IdentityService\AzureServiceAuth 文件夹,但也没有帮助。

英文:

Visual Studio picks the wrong tenant id in an attempt to login Azure in the integrated Microsoft Identity platform tool, I do not have such a GUID that it shows me, my tenant id Guid is different for the user, and user name is shown right in the error message. I tried to search the GUID that it shows me (starting at f8cd..) in Azure portal, but was not able to find anything, no idea where VS takes it from, could be some old one that I used long in the past.

Visual Studio 2022缓存了旧的租户ID,无法摆脱它。

I restarted studio, rebooted Windows, signed out, signed in, nothing helps. I clean up \AppData\Local\.IdentityService\AzureServiceAuth, it did not help either.

When I type az account show in the cmd, it displays right user and right tenant id with home tenant id

Checking/unchecking the box in VS settings does not help either
Visual Studio 2022缓存了旧的租户ID,无法摆脱它。

答案1

得分: 2

需要检查以下步骤:

  1. 缓存问题:

    转到Visual Studio右上角的帐户设置,删除所有已登录的帐户,然后使用所需的帐户重新输入您的凭据。这将帮助您解决缓存问题。

    参考SO上的我的解决方法以获取更多相关信息。

  2. 转到

    控制面板 >> 用户帐户 >> 凭据管理器 >> Windows凭据
    

    按照图像所示删除Visual Studio凭据,然后添加它。

  3. 通过转到
    工具 > 导入和导出设置 > 重置所有设置

    工具 >> 选项 >> 环境 >> 帐户 >> 清除所有已登录的帐户。
    
  4. 如果以上方法都无效,请尝试通过转到

    控制面板 >> 程序和功能 >> Microsoft Visual Studio >> 更改 >> 修复
    

如果问题仍然存在,请卸载Visual Studio,然后从Visual Studio官方网站重新安装最新版本。

英文:

Need to check below steps:

  1. Cache issue:

Goto the account settings on the top right corner of the Visual studio and remove all the existed logged in accounts and reenter your credentials with the required one. This will help you to resolve the cache issue.

Visual Studio 2022缓存了旧的租户ID,无法摆脱它。

Refer SO worked by me for more relevant information.

  1. Goto the
control panel >> User accounts >> Credential Manager >> Windows Credentials

Remove the Visual Studio credentials as shown in the image and add it.

Visual Studio 2022缓存了旧的租户ID,无法摆脱它。

  1. Reset all settings in Visual Studio by going to
    Tools > Import and Export Settings > Reset all settings.

Or

Tools >> Options >> Environment >> Accounts >> Clear all the logged in accounts.

Visual Studio 2022缓存了旧的租户ID,无法摆脱它。

  1. If none of the above works, try repairing the Visual Studio installation by going to
Control Panel >> Programs and Features >> Microsoft Visual Studio >> Change >> Repair

Visual Studio 2022缓存了旧的租户ID,无法摆脱它。

If still the issue persists, uninstall the visual studio and reinstall it with the latest version from Visual studio official site.

答案2

得分: 0

我们遇到了相同的问题。原来我们设置了一个系统环境变量,它覆盖了在Visual Studio中登录的Azure帐户:

AZURE_TENANT_ID="XXXXXXXX-XXXX-...."

删除这个环境变量,并重新启动Visual Studio后,问题得以解决。

英文:

We were experiencing the same issues. Turns out we had a system environment variable set that was overriding the Azure account logged in within VS:

AZURE_TENANT_ID="XXXXXXXX-XXXX-...."

After removing this environment variable, and restarting Visual Studio, the problem was resolved.

huangapple
  • 本文由 发表于 2023年4月7日 03:33:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75953145.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定