0
votes

I have a build in Visual Studio Team Services (VSTS) that needs to restore NuGet packages from a private package feed hosted in VSTS. The build fails with an Unauthorized message (401) when it tries to access the private feed.

After some reading I found out I should use the Microsoft VSTS Credential Provider for NuGet to access the private feed. Normally I wouldn't object to add a tool to each repository, but the thing that bothers me is that this executable is a whopping 14MB and I need to include it in a lot of repositories.

My attempt to resolve this was by adding a 'Download Package'-task for the Credential Provider Package, but that only works for VSTS feeds and not for NuGet feeds.

Now I wonder if I'm doing things correctly here, because this shouldn't be that difficult. Shouldn't the Credential Provider be installed on the buildserver by default or at least be made available as a Task?

2

2 Answers

0
votes

I was able to solve it by exchanging the dotnet restore Task for a NuGet Restore task. That task allows me to point to a VSTS package feed. It's strange that the dotnet restore task doesn't support the credential providers.

0
votes

You can specify Nuget.config file by specifying –configfile arguments for .Net Core Restore step/task, for example: --configfile $(build.sourcesdirectory) /Nuget.Config.