Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Credentials for Azure Nuget Feed in Visual Studio

I am moving my existing project to a new machine. I am using a custom Azure Nuget feed with a url in the form:

https://pkgs.dev.azure.com/company/project/_packaging/project.Libs/nuget/v3/index.json

When I try to build, I get the error:

NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/company/project/_packaging/project.Libs/nuget/v3/index.json Response status code does not indicate success: 401 (Unauthorized).

I also cannot browse the packages in the feed.

I am logged in in my browser and can see the content of the json file of the feed but of course not in a private session.

On my old machine I don't remember how the feed was added and I also haven't saved my username/password anywhere (e.g. in NuGet.config, which seems to be a suggested solution).

Does anyone know how to provide the credential to VS so that it can access the feed?

like image 706
Vladimir Avatar asked Nov 19 '25 13:11

Vladimir


1 Answers

I was able to fix this by:

  • Logging out of Visual Studio (top right)
  • Creating a new project and adding a new Nuget feed from the URL of my Azure artifacts
  • Nuget asked me to login again and the account I had been using was listed there. I did not select it but said "use another account"
  • I logged in again with the same account, providing username, password and two factor authentication

Now everything works fine.

like image 134
Vladimir Avatar answered Nov 21 '25 10:11

Vladimir