1

I have a DevOps issue while publishing packages. I am a user of Azure-Repository, Azure-CI, and Azure-Artifacts. I have defined an Organization with 7 projects, one assigned for storing artifacts in project-scoped feeds. The other are .NET-Core based web services, git top level solution container, and a shared library. All projects defined a service connection to connect to my artifact XyzArtifacts/XyzArtifactFeeds.

Yesterday, after making some changes to the shared project, I noticed that my push command was failing, and after some research became aware that Linux 24.04.1 LTS removed features such as Mono, and Azure pipeline can no longer run commands such as NuGetCommand@2 on it. After searching more, I came across several options, and I chose migrating to DotNetCoreCLI@2, but from 9~10PM till the morning 9 AM, I did everything I found, but no luck, including testing different flags, giving permission to pipeline agents of other project directly in artifact project project-scoped feed, ....

I believe that these two options I found are bad practice, to hardcode Linux version, and stick to the past, and increase the margin of required migrations (changes) at the required time. and the other to install packages directly into Linux using script (either their support will expire, and as ChatGPT suggested, the weight of those packages is huge, and can cause pipeline to fails if installed separatly).

my best option is to use trusted, and long term script, or fix the DotNetCoreCLI@2 command to work with my current setup...

My previous setup

... # Authenticate with Azure Artifacts before restoring packages - task: NuGetAuthenticate@1 inputs: nuGetServiceConnections: 'AzureArtifactsNuget' # Ensure this matches the service connection name displayName: 'Authenticate with Azure Artifacts' ... - task: NuGetCommand@2 inputs: command: 'push' packagesToPush: '$(CORE_NUGET_PACKAGES_DIRECTORY)/*.nupkg' publishVstsFeed: '$(AZURE_FEED_NAME)' nuGetFeedType: 'internal' allowPackageConflicts: true displayName: 'Publish `Core` package to Azure Artifacts' condition: and( succeeded(), eq(variables['CheckTag.CORE_SKIP_PUSH'], 'false') ) ... 

I tried with this script and DotNetCoreCLI with lots of different flag, as follow:

- task: DotNetCoreCLI@2 displayName: 'Push `Core` package via DotNetCoreCLI inputs: command: 'push' nuGetFeedType: 'internal' feedPublish: '$(AZURE_FEED_NAME)' packagesToPush: '$(CORE_NUGET_PACKAGES_DIRECTORY)/*.nupkg' allowPackageConflicts: true includeNuGetOrg: false publishPackageMetadata: true # (optional) disable only if metadata causes errors condition: and(succeeded(), eq(variables['CheckTag.CORE_SKIP_PUSH'], 'false')) 

How to make it work without the need for changes every day?

1 Answer 1

0

I tried many things with no luck, in the end I was forced to use the script, and it worked just fine with no issue. I also asked a DevOps member, and he said if it works, don't touch it, and it's not a bad thing. I hoped for more, but that's all I got, but to set my mind as well to advance the project rather than waste my time.

 - script: | dotnet nuget push \ "$(UTILS_NUGET_PACKAGES_DIRECTORY)/*.nupkg" \ --source "$(AZURE_FEED_FULL_URL)" \ --api-key az \ --skip-duplicate displayName: 'Push `Utils` package with skip-duplicate' condition: and(succeeded(), eq(variables['CheckTag.UTILS_SKIP_PUSH'], 'false')) 

Just note the variable for source, unlike the NuGetCommand@2, must be the FULL URL

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.