I'm trying to automate the push of a nuget package from Visual Studio to Azure Devops Artifact when I'm build the solution.I'm able to do that utomatically on my local nuget repository, but I'm not able to do it on my Azure repo. It fails with a 401 (unathorized) because I cannot put credentials on the command and the VS credential are not used.To automate the publishing Ive set this command on the project file:
<Target Name="NugetAdd" AfterTargets="Pack"><exec command="nuget add $(OutputPath)$(PackageId).$(PackageVersion).nupkg -source d:\NuGetLocal" /> <exec command="nuget push -source MyAzureRepo -ApiKey VSTS $(OutputPath)$(PackageId).$(PackageVersion).nupkg" /> </Target>
The first command is executed successfully, and the second fails because credential are requested. If I run the command in a powershell it runs without problem, asking for credentials.There is a way to make it working?