Visual Studio及VS Code连接Azure账户失败问题求助
问题描述
Visual Studio连接Azure账户时触发超时错误,具体报错:
There was a problem getting the tenant info 'System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (management.azure.com:443)
---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
已确认:
- PowerShell执行
Connect-AzAccount可正常连接Azure - 防火墙未限制相关网络访问
- 系统代理设置未发生变更
排查与解决步骤
重置Azure服务认证缓存
关闭Visual Studio,手动删除以下目录下的缓存文件:%LOCALAPPDATA%\Microsoft\VisualStudio\<你的VS版本号>\ConnectedUser\AuthTokens%LOCALAPPDATA%\Microsoft\AzureServiceAuth
重启Visual Studio后重新尝试连接账户
验证Visual Studio独立代理配置
打开Visual Studio,依次进入工具 > 选项 > 环境 > Web 代理,确认代理设置为自动检测设置,或与PowerShell使用的代理配置完全一致(VS可能单独缓存了旧代理规则)更新Visual Studio及Azure扩展
运行Visual Studio Installer,安装所有可用的VS更新包;同时进入扩展 > 管理扩展,检查Azure Tools扩展是否为最新版本,若存在异常则卸载后重新安装重置Visual Studio用户数据
打开命令提示符,执行命令:devenv /resetuserdata重置完成后重启Visual Studio,重新配置Azure账户连接
内容的提问来源于stack exchange,提问作者tonycdp




