I've created a feed in Azure Artifacts, to which I want to publish Nuget packages. I have generated a Personal Access Token with the correct scope.
Running this command succeeds:
> nuget.exe push -Source "myAzureFeed" -Apikey $(cat apikey) .\bin\Debug/MyPackage1.2.3.nupkg
Whereas, this command:
> dotnet nuget push .\bin\Debug\MyPackage.1.2.3.nupkg -s "myAzureFeed" -k $(cat apikey)
Gives me 401
PS D:\NuGet\create-package\using-dotnet-cli> dotnet nuget push .\bin\Debug\MyPackage.1.2.3.nupkg -s myAzureFeed -k $(cat apikey)
Pushing MyPackage.1.2.3.nupkg to 'https://pkgs.dev.azure.com/123/abc/_packaging/xyz/v2/'...
PUT https://pkgs.dev.azure.com/123/abc/_packaging/xyz/nuget/v2/
Unauthorized https://pkgs.dev.azure.com/123/abc/_packaging/xyz/v2/'...
PUT https://pkgs.dev.azure.com/123/abc/_packaging/xyz/nuget/v2/ 1323ms
error: Response status code does not indicate success: 401 (Unauthorized).
Why does nuget.exe push succeeds and dotnet nuget push fails?