Jens Bright
Jens Bright

Reputation: 33

Please provide credentials error pushing to Azure DevOps

I am getting the error

"Please provide credentials for: https://jbright.pkgs.visualstudio.com/Project/_packaging/Project_Feed/nuget/v3/index.json"

from Visual Studio 2019 Community Powershell when I run the command:

nuget push -Source https://jbright.pkgs.visualstudio.com/Project/_packaging/Project_Feed/nuget/v3/index.json -ApiKey az C:\Users\Jens\source\repos\Project\Packed\Project.Core.0.4.0.7.nupkg 

I've tried what I've been able to find online to fix this including:

I have a nuget.config file in the project directory that contains:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="Core_Feed" value="https://jbright.pkgs.visualstudio.com/Project/_packaging/Project_Feed/nuget/v3/index.json" />
  </packageSources>
</configuration>

<!--

nuget push -Source https://jbright.pkgs.visualstudio.com/Project/_packaging/Project_Feed/nuget/v3/index.json -ApiKey az C:\Users\Jens\source\repos\Project\Packed\Project.Core.0.4.0.7.nupkg  

-->

I keep the powershell command syntax in the file so I don't forget it, but as you can see it is commented out. The thing is, this works fine on my laptop with the same files.

When I delete the credentials in credential manager and then pull packages from this Azure DevOps feed, I get the packages and see the new credentials added to Windows. But even so, I cannot pucs a package to the feed without getting the "Please provide credentials' error.

Any idea how to fix this? thanks, Jens

Upvotes: 3

Views: 3873

Answers (1)

Mr Qian
Mr Qian

Reputation: 23740

When I delete the credentials in credential manager and then pull packages from this Azure DevOps feed, I get the packages and see the new credentials added to Windows. But even so, I cannot pucs a package to the feed without getting the "Please provide credentials' error.

First, please try to use the newest version of nuget.exe cli from this link and then config the nuget.exe cli path from the local agent into System Environment variable PATH.

Second, you should add packageSourceCredentials for your private nuget package source in Nuget.config file:

<packageSourceCredentials>
    <Core_Feed>
        <add key="Username" value="xxx" />
        <add key="Password" value="xxx" />
       xxx
    </Core_Feed>

</packageSourceCredentials>

More info you can refer to this link.

Then, test whether you can push your nuget packages.

Upvotes: 2

Related Questions