DevOps Pipeline访问NuGet源报401未授权,如何排查及反馈?
DevOps Pipeline在windows-latest镜像中安装AzureSignTool时出现NuGet源401未授权错误
所有DevOps Pipeline无法访问作为DevOps Artifact的NuGet源。使用微软托管代理的windows-latest镜像执行安装AzureSignTool的CmdLine任务时,报错401未授权。
已执行以下排查操作但均无效:
- 确认Project\Build Administrators为该NuGet源的所有者
- 尝试更换NuGet、AzureSignTool版本
- 将RestoreNuGetPackages任务前置,可成功验证身份,但安装任务仍失败
- 添加
--ignore-failed-sources参数无作用
切换至windows-2019镜像可解决该问题,但项目依赖VS2022的TextTransform路径,导致后续构建失败。
需明确:
- 需要检查哪些权限/设置?
- 如何向微软相关团队反馈此问题?
相关配置及错误信息
安装任务YAML:
- task: CmdLine@2 displayName: 'Install AzureSignTool' inputs: script: | set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true dotnet tool install --global AzureSignTool --version 4.0.1
初始错误:
Unhandled exception: NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source . ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
更新后错误:
[NuGet Manager] [Info] GET https://api.nuget.org/v3/registration5-gz-semver2/azuresigntool/index.json [NuGet Manager] [Info] GET https://{ORG}.pkgs.visualstudio.com/_packaging/{GUID}/nuget/v3/registrations2-semver2/azuresigntool/index.json [NuGet Manager] [Info] Unauthorized https://{ORG}.pkgs.visualstudio.com/_packaging/{GUID}/nuget/v3/registrations2-semver2/azuresigntool/index.json 767ms [NuGet Manager] [Info] OK https://api.nuget.org/v3/registration5-gz-semver2/azuresigntool/index.json 1010ms Unhandled exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
内容的提问来源于stack exchange,提问作者Ryan Thomas
相关产品推荐
相关产品推荐

