Skip to content

Reference registry service connections in cleanup Clean job#2058

Merged
lbussell merged 1 commit intodotnet:mainfrom
lbussell:cleanup-service-connections
Mar 31, 2026
Merged

Reference registry service connections in cleanup Clean job#2058
lbussell merged 1 commit intodotnet:mainfrom
lbussell:cleanup-service-connections

Conversation

@lbussell
Copy link
Copy Markdown
Member

@lbussell lbussell commented Mar 31, 2026

The Clean job runs cleanAcrImages against both BuildRegistry and PublishRegistry, but only referenced the cleanServiceConnection in its reference-service-connections call. Without usesRegistries, the registry-specific service connections from RegistryAuthentication were never referenced in the stage, causing AzurePipelinesCredential OIDC token exchange to fail with:

There is no explicit reference to service connection ... from current stage Execute.Clean.__default.

Failing pipeline run: build#2939996

This PR adds usesRegistries for both BuildRegistry and PublishRegistry so their service connections are referenced for OIDC.

#2044 was an attempted fix, but it was incorrect and later reverted in #2052. That change broke cleanup since the cleanup pipeline uses the ORAS CLI internally to check image lifecycle annotations. The ORAS CLI uses Docker login instead of Azure SDK for authentication. This will not be necessary once #2050 is merged.

The Clean job runs cleanAcrImages against both BuildRegistry and
PublishRegistry, but only referenced the cleanServiceConnection in
its reference-service-connections call. Without usesRegistries, the
registry-specific service connections from RegistryAuthentication
were never referenced in the stage, causing AzurePipelinesCredential
OIDC token exchange to fail with:

  'There is no explicit reference to service connection ... from
   current stage Execute.Clean.__default.'

Add usesRegistries for both BuildRegistry and PublishRegistry so
their service connections are referenced for OIDC.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lbussell lbussell requested a review from a team as a code owner March 31, 2026 17:43
@lbussell lbussell merged commit e5572c9 into dotnet:main Mar 31, 2026
20 checks passed
@lbussell lbussell deleted the cleanup-service-connections branch March 31, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants