Reference registry service connections in cleanup Clean job#2058
Merged
lbussell merged 1 commit intodotnet:mainfrom Mar 31, 2026
Merged
Reference registry service connections in cleanup Clean job#2058lbussell merged 1 commit intodotnet:mainfrom
lbussell merged 1 commit intodotnet:mainfrom
Conversation
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>
nagilson
approved these changes
Mar 31, 2026
NikolaMilosavljevic
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Clean job runs
cleanAcrImagesagainst bothBuildRegistryandPublishRegistry, but only referenced thecleanServiceConnectionin itsreference-service-connectionscall. WithoutusesRegistries, the registry-specific service connections fromRegistryAuthenticationwere never referenced in the stage, causingAzurePipelinesCredentialOIDC token exchange to fail with:Failing pipeline run: build#2939996
This PR adds
usesRegistriesfor bothBuildRegistryandPublishRegistryso 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.