I'm using the built in nuget task in VSTS to do a package restore. Our feed is hosted on an internal Artifactory server, and is referenced as a package source in my nuget.config. I'm then using a nuget service endpoint in VSTS to store the credentials to access that feed.
But when I run the build I get the following in the build log, and every request to the nuget feed results in a 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'.
Is there anything else I need to configure to get the task to pickup the credentials in the service endpoint? If I just put them as packageSourceCredentials
in the nuget.config, it all works fine.