microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

[REGRESSION]: DotNetCoreCLI - Restore with external feed does not properly authenticate anymore #20347

Open Tech-Non opened 2 weeks ago

Tech-Non commented 2 weeks ago

New issue checklist

Task name

DotNetCoreCLI@2

Breaking task version

2.244.1

Last working task version

2.242.1

Regression Description

I have a bit of a weird setup with a nuget feed in one Azure DevOps organization and a pipeline in another organization that needs the feed to restore a project. about 3 hours ago this step worked fine but now it only logs the following message for these resources:

1>/agent/_work/2/s/PROJECT.Infrastructure.Persistence/RPOJECT.Infrastructure.Persistence.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/FEED_URL/nuget/v3/index.json. [/agent/_work/2/s/PROJECT.API/PROJECT.API.csproj]

Code-wise there have been no changes and the only thing I can see has changed is the version of the task going up to 2.244.1

For reference, this is the task:

  - task: DotNetCoreCLI@2
    displayName: 'Restore .NET dependencies'
    inputs:
      command: 'restore'
      projects: '**/*.csproj'
      feedsToUse: config
      nugetConfigPath: 'nuget.config'
    env:
      VSS_NUGET_EXTERNAL_FEED_ENDPOINTS: '{"endpointCredentials": [{"endpoint":"$(nugetFeedUrl)", "username":"AzureDevOps", "password":"$(personal_access_token)"}]}'

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04

Relevant log output

`1>/agent/_work/2/s/PROJECT.Infrastructure.Persistence/RPOJECT.Infrastructure.Persistence.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/FEED_URL/nuget/v3/index.json. [/agent/_work/2/s/PROJECT.API/PROJECT.API.csproj]`

Full task logs with system.debug enabled

UNSUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 
SUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

No response

aleksandrlevochkin commented 2 weeks ago

Removed off-topic spam comments containing dubious links

DanPatten commented 2 weeks ago

Same issue here, we had to pin an older version as it broke all of our existing pipelines.

bt-Knodel commented 2 weeks ago

We are using self hosted ADO agents and ran into this exact scenario as well.

Using NugetCommand@v2:

  1. 2.238.1 works perfectly fine
  2. 2.244.1 breaks the setup in all pipelines

Unsure how to try versions in-between, but somewhere between this broke.

DenisNikulin5 commented 2 weeks ago

Hi @Tech-Non. Thanks for reporting! We are investigating the issue

aleksandrlevochkin commented 1 week ago

Hi @Tech-Non! Could you please provide an example of a failing and a successful pipeline run, with system.debug variable set to "true" and the task input verbosityRestore set to "Diagnostic". If the logs contain sensitive data, please, consider opening an issue on https://developercommunity.visualstudio.com/AzureDevOps and mark your message as private