microsoft / azure-pipelines-tasks

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

[REGRESSION]: NuGetAuthenticate failing when updating existing credentials #20334

Open davidcorrigan714 opened 3 weeks ago

davidcorrigan714 commented 3 weeks ago

New issue checklist

Task name

NuGetAuthenticate

Breaking task version

1.244.1

Last working task version

1.238.1

Regression Description

We have pipelines that authenticate to NuGet repos multiple times which now fail with a validation error: "##[error]Error: An existing service connection already exists for the endpoint". This seems to have been added in #20299 by @embetten . We have multiple layers of templates that may authenticate to our repo using different credentials to fetch different things which seems like a very valid thing to do to me. Sorting out all those to restructure them and only authenticate once would be very tricky for us.

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

Windows 11

Relevant log output

##[error]Error: An existing service connection already exists for the endpoint ...

Full task logs with system.debug enabled

No response

Repro steps

Authenticate to a nuget repo twice in the same pipeline.
embetten commented 3 weeks ago

This scenario should be fixed with #20344 (really updated here )where we allow existing service connections to be overwritten in the environment variable.

It is also more strictly ensuring only one entry can be added per feed URLs to avoid confusion around multiple entries.

let me know if this covers all scenarios that were breaking.