Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 14, 2025

Azure Pipeline Fix Plan

  • Explore repository and understand the pipeline configuration
  • Test build process locally to verify NuGet package generation
  • Identify the root cause of the pipeline failure
  • Fix the pipeline configuration to use correct DotNetCoreCLI@2 parameters
  • Test the fix locally and verify NuGet package is created
  • Address build error feedback from PR review
  • Consolidate configuration parameter into arguments
  • Fix Ubuntu 24.04 mono dependency issue
  • Run code review
  • Run security check

Changes Made

Fixed the Azure Pipeline build process to properly generate and publish NuGet packages:

  1. Build step: Removed --output and --version-suffix arguments that interfere with pack
  2. Pack step: Fixed DotNetCoreCLI@2 task parameters:
    • Changed invalid packDirectory parameter to outputDir
    • Removed separate configuration parameter to avoid conflicts with --no-build
    • Consolidated all flags into arguments parameter: --configuration $(BuildConfiguration) --version-suffix prerelease-$(PipelineDate) --no-build
  3. Push step: Replaced NuGetCommand@2 with DotNetCoreCLI@2 push command:
    • Removed NuGetToolInstaller@1 task (not needed)
    • Changed from NuGetCommand@2 to DotNetCoreCLI@2 with command: push
    • Added nuGetFeedType: internal parameter
    • This fixes the Ubuntu 24.04 mono dependency issue

Root Cause

The Azure Pipeline was failing due to:

  1. Using --output with dotnet build which places artifacts in non-standard locations
  2. Using invalid parameters in DotNetCoreCLI@2 pack task (packDirectory doesn't exist)
  3. Mixing configuration parameter with --no-build flag which can cause conflicts
  4. Using NuGetCommand@2 which requires Mono on Linux, but Ubuntu 24.04 doesn't have it by default

The correct approach is to:

  • Use DotNetCoreCLI@2 for all .NET operations (build, pack, push) which doesn't require Mono
  • Pass --configuration explicitly in the arguments when using --no-build

Security Summary

No security vulnerabilities introduced or detected in these configuration changes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Azure Pipeline is failing and NuGet package is not being published</issue_title>
<issue_description>It looks like the Azure Pipeline is currently broken, and as a result the latest version is not being packed as NuGet.

Could someone please take a look at the pipeline and fix the issue so we can get the prerelease NuGet package.</issue_description>

<agent_instructions>The pipeline still fails. You can view the status here: https://dev.azure.com/DigitalRuby/DigitalRuby/_build?definitionId=6</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: vslee <366757+vslee@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Azure Pipeline failure for NuGet package publishing Fix Azure Pipeline NuGet package generation Dec 14, 2025
Copilot AI requested a review from vslee December 14, 2025 00:26
@vslee vslee marked this pull request as ready for review December 14, 2025 00:27
@vslee vslee requested a review from jjxtra December 14, 2025 00:27
@vslee
Copy link
Collaborator

vslee commented Dec 14, 2025

…Directory

Co-authored-by: vslee <366757+vslee@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 14, 2025

@copilot did you address the error msg "https://dev.azure.com/DigitalRuby/DigitalRuby/_build/results?buildId=2255&view=logs&j=6c230c74-3921-5468-7439-05c9fea1c84a&t=05e98f91-80a8-570a-b98f-8f1fcc31463...

Fixed in commit 7f3ba2c. The error was caused by invalid parameter names in the DotNetCoreCLI@2 pack task. Changed packDirectory to outputDir and moved version-suffix to the arguments parameter, which are the correct parameters for the Azure Pipelines task.

@vslee
Copy link
Collaborator

vslee commented Dec 14, 2025

@copilot check the pipeline status again

Co-authored-by: vslee <366757+vslee@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 14, 2025

@copilot check the pipeline status again

Updated in commit a575211. The issue was mixing the configuration parameter with --no-build flag in the pack task. Consolidated everything into the arguments parameter to ensure the pack command uses the same configuration as the build: --configuration $(BuildConfiguration) --version-suffix prerelease-$(PipelineDate) --no-build. The pipeline should now work correctly.

@vslee
Copy link
Collaborator

vslee commented Dec 14, 2025

@copilot the error is "The task has failed because you are using Ubuntu 24.04 or later without mono installed. See https://aka.ms/nuget-task-mono for more information."

… issue

Co-authored-by: vslee <366757+vslee@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 14, 2025

@copilot the error is "The task has failed because you are using Ubuntu 24.04 or later without mono installed. See https://aka.ms/nuget-task-mono for more information."

Fixed in commit 30970c3. Replaced NuGetCommand@2 with DotNetCoreCLI@2 push command, which doesn't require Mono. Also removed the NuGetToolInstaller@1 task. The DotNetCoreCLI@2 task is the modern approach for .NET projects and works on Ubuntu 24.04 without Mono dependencies.

@vslee vslee merged commit ed7fa18 into main Dec 14, 2025
4 checks passed
Copilot AI requested a review from vslee December 14, 2025 00:54
@vslee vslee added the maintenance such as tests label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance such as tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure Pipeline is failing and NuGet package is not being published

3 participants