Azure DevOps publish Nuget to hosted feed

I have found the trouble with this at moment, after 1 hour of checks. I can see that by default, when you create a Feed over Artifacts on your AzureDevOps project, it's only have permission for Project collection Build Service but not for your project Build Services.

Let's check the image below and compare with your Feed Settings.

Going toFeed Settings/Permission through Gear Button on right side of artifacts page enter image description here

this is the code for my task

- task: NuGetCommand@2
  displayName: 'nuget push'
  inputs:
    command: 'push'
    feedsToUse: 'select'
    packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
    nuGetFeedType: 'internal'
    vstsFeed: kreaCore/kreaCore
    publishVstsFeed: kreaCore/kreaCore
    versioningScheme: 'off'
    allowPackageConflicts: true

And the expected result is

enter image description here

This is a useful tutorial for replicate my test.

Cheers!!


I created a new Azure Artifacts feed a few days ago and ran headlong into this while attempting to create a .NET Core/Standard NuGet build pipeline similar to this example. The rest of my CI pipeline ran perfectly, but the NuGet Push task failed every time with exactly the same error in the Azure Pipelines log, despite all my attempts to find a workaround:

The feed with ID '{my_feed_name}' doesn't exist.

Since the feed did most certainly exist, I dug a bit more and discovered other similar reports of a bug in Azure Pipelines. Apparently, Microsoft recently changed the default scope level for new feeds to Project instead of Organization, which broke several Azure Pipeline tasks. Older feeds don't seem to be affected by this issue. See this forum post:

New feeds are now by default project-scoped and a required fix for the pipeline tasks failed to get deployed. We are pushing out a hotfix to update to the newest pipeline task versions and it should be out by the end of the day.

Hopefully, Microsoft will resolve this issue soon.


For project-scoped feeds use publishVsTsFeed: '<yourProjectName>/<yourFeedName>'

In the first example of @sascha the task should look like:

- task: NuGetCommand@2
  displayName: 'NuGet push'
  inputs:
    command: 'push'
    packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
    nuGetFeedType: 'internal'
    publishVstsFeed: 'NugetProjects/nugetprojectstestfeed'
    allowPackageConflicts: true

The package is copied to the feed only if the version number is higher as the package in the feed. Otherwise nuget push will report a conflict, but will pass anyway because of allowPackageConflicts: true (in contrast to DotNetCoreCLI@2 push)!