Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • Deleting all credentials in Windows Credential Manager
  • Removing and re-adding this package source in Visual Studio Package Manager settings

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

like image 280
Jens Bright Avatar asked Apr 10 '26 04:04

Jens Bright


1 Answers

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.

like image 52
Mr Qian Avatar answered Apr 11 '26 22:04

Mr Qian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!