Itiviti / gradle-nuget-plugin

Executes NuGet from a gradle build
Apache License 2.0
22 stars 29 forks source link

Plugin won't work for Azure NuGet 3 #72

Open vitaliy-sharandin opened 5 years ago

vitaliy-sharandin commented 5 years ago

Hey! The issue we have encountered is that the plugin doesn't currently support v3 of Azure NuGet. We have launched plugin as was instructed and tried to push artifact to Azure Artifacts. The result was an UnAuthorized(401) error despite apikey provision in nugetPush task.

Yet once launched from command line, NuGet.exe is actually waiting for username and password to be provided, that is why it's getting Unauthorized when launched from Gradle. As it turns out, there should also be a CredentialsProvider.VSS in the same folder as NuGet.exe, which will take care of authentication.

Our current workaround was to create additional task which downloads CredentialsProvider and make nugetPush depend on this task.

It would be nice to have this functionality available in plugin though.

Here is an article which describes how Azure Nuget works, there is also a possibility to directly download zip with CredentialsProvider described in this article: https://docs.microsoft.com/en-us/azure/devops/artifacts/nuget/nuget-exe?view=azure-devops&tabs=new-nav#add-a-feed-to-nuget-3-or-later