VSTS unable to load the service index for source 401

11,541

You can update the VSTS feed with credentail (PAT or alternate credential) in the specified nuget.config file.

Such as:

nuget sources update -Name "vstsfeed" -Source https://microsoft.pkgs.visualstudio.com/_packaging/CBT/nuget/v3/index.json -Username "Alternate username" -Password "alternate password" -configfile /path/to/nuget.config

Then you can commit the changes for the nuget.config file and push to VSTS repo. And build again to check if it works.

Share:
11,541

Related videos on Youtube

checai
Author by

checai

Updated on June 04, 2022

Comments

  • checai
    checai almost 2 years

    I'm aware of the other posts about the same signature. I still can't resolve my issue after going thru them.

    My team uses VSTS's build definition for continuous integration. enter image description here

    This build definition works fine until the lastes pull request. I'm running into the error msg below during the Nuget Restore

    2018-06-20T00:37:27.6438127Z System.AggregateException: One or more errors occurred. ---> NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://microsoft.pkgs.visualstudio.com/_packaging/CBT/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).

    I do have https://microsoft.pkgs.visualstudio.com/_packaging/CBT/nuget/v3/index.json in the nuget.config, and there is nothing changed in the nuget.config in the failing PR

    I can nuget restore and build the entire solution successfully on my local machine using VS2017. The only related change in the PR is that instead of using package.config, it uses packagereference to get the nuget package. I tried to move back to using package.config, the build would still fail with the same error msg.

    Thanks in advance.

  • John Korsnes
    John Korsnes over 5 years
    Why would you recommend to put a password into source control?
  • Marina Liu
    Marina Liu almost 5 years
    The password will be encoded in nuget.config file, so it's not put a password into source control.