1
votes

I have a private feed in Azure DevOps, I am the owner of the feed and in order to access Azure DevOps I use my work account.

When accessing the feed from package manage console a pop up is displayed to enter my credentials, but entering the work account credentials returns a 401 feed. If I try to access the feed in the browser again it prompts me to enter my credentials but I just end up in a loop asking for my credentials.

I've managed to get nuget cli working after following the instructions here:

https://docs.microsoft.com/en-us/azure/devops/artifacts/nuget/bootstrap-nuget?view=vsts

However Visual Studio Package Manager console doesn't seem to want to use the CredentialProvider.VSS.exe and so is giving me the popup.

1) Where would I look for why it is giving me a 401? I'm the owner of the feed and feed is set to be accessible to people in my organisation?

2) The linked artice above states "Developer credentials are not placed in the repo's nuget.config. When init runs, it places credentials in the user's NuGet config under %APPDATA%". However looking at this and it has not placed any credentials in that file

Sometimes when using Package Manager console I get the following:

No valid credentials found for VSO account

Any pointers greatly appreciated.

1
For note I'm using: Visual Studio 2017 Nuget 4.9.2oceanexplorer

1 Answers

0
votes

Accessing Azure DevOps package feed with Azure AD Work Account

When I first configured the Azure DevOps package feed in Visual Studio, I got the same 401 error message as you. The reason is as you said Visual Studio Package Manager console not use the CredentialProvider.VSS.exe. So, to resolve this issue, we need to provide credentials to Visual Studio manually with nuget.config file:

Add following content in the nuget.config:

  <packageSources>
    <add key="AzureDevOpsFeed" value="<ThePackageSourceFeedUrl>/MyCustomFeed/nuget/v3/index.json" />
  </packageSources>


  <packageSourceCredentials>
    <AzureDevOpsFeed>
      <add key="Username" value="<YourUserName>" />
      <add key="ClearTextPassword" value="<YourPassword>" />
    </AzureDevOpsFeed>
  </packageSourceCredentials>

After that, we could use Azure DevOps package feed in Visual Studio. And if you want to use this package feed with nuget restore task on build definition, you can select the option Feed in my nuget.config:

enter image description here

Hope this helps.