【发布时间】:2018-03-29 09:57:14
【问题描述】:
我正在使用 VSTS 中的内置 nuget 任务来执行包还原。我们的提要托管在内部 Artifactory 服务器上,并在我的 nuget.config 中作为包源引用。然后,我在 VSTS 中使用 nuget 服务端点来存储访问该提要的凭据。
但是当我运行构建时,我会在构建日志中看到以下内容,并且对 nuget 提要的每个请求都会导致 401 Unauthorized。
CredentialProvider.TeamBuild: URI Prefixes:
CredentialProvider.TeamBuild: https://ukipo.visualstudio.com/
CredentialProvider.TeamBuild: https://ukipo.pkgs.visualstudio.com/
CredentialProvider.TeamBuild: URI: http://repo1:8081/artifactory/api/nuget/nuget-repos
CredentialProvider.TeamBuild: Is retry: False
CredentialProvider.TeamBuild: Matched prefix:
CredentialProvider.TeamBuild: This provider only handles URIs from the build's Team Project Collection
Unauthorized http://repo1:8081/artifactory/api/nuget/nuget-repos/Packages(Id='Microsoft.AspNet.Razor',Version='3.2.3') 16ms
WARNING: Unable to find version '3.2.3' of package 'Microsoft.AspNet.Razor'.
http://repo1:8081/artifactory/api/nuget/nuget-repos: The V2 feed at 'http://repo1:8081/artifactory/api/nuget/nuget-repos/Packages(Id='Microsoft.AspNet.Razor',Version='3.2.3')' returned an unexpected status code '401 Unauthorized'.
我还需要配置其他什么来获取在服务端点中获取凭据的任务吗?如果我只是将它们作为 packageSourceCredentials 放在 nuget.config 中,一切正常。
【问题讨论】:
标签: nuget azure-devops azure-pipelines