I have a question using the hosted (free) AzureDevops pipelines. I have a small .NET Core project which I want to create an Azure Devops pipeline where the following is done
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)!
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.
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 to
Feed Settings/Permission
throughGear Button
on right side of artifacts page
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
This is a useful tutorial for replicate my test.
Cheers!!
You have missed setting some required arguments in your NuGetCommand@2 task.
Try this:
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
feedsToUse: select
vstsFeed: nugetprojectstestfeed
nuGetFeedType: internal
publishVstsFeed: nugetprojectstestfeed
allowPackageConflicts: true
If we look into the documentation of NuGet task, for 'push' command certain arguments are required.
As per the answer from @mwimwi, including the project name in the feed path worked for me:
- task: DotNetCoreCLI@2
displayName: Push
inputs:
command: push
packagesToPush: ...
feedPublish: <project-name>/<feed-name>
I have done two changes like below,
In the FeedSetting Permissions, selected "Allow project-scoped builds"
The YML file updated for NuGetCommand like below,
task: NuGetCommand@2
displayName: 'Publish NuGet package'
inputs:
command: push
feedsToUse: 'select'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'Space Game - web - Dependencies/Tailspin.SpaceGame.Web.Models'
allowPackageConflicts: true
And the issue is resolved now...
Thank you guys...
~KC