From 5536cc6a269e8847a57a542fb45035b7f7cff9f5 Mon Sep 17 00:00:00 2001 From: Logan Bussell Date: Tue, 31 Mar 2026 10:31:39 -0700 Subject: [PATCH] Reference registry service connections in cleanup Clean job 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> --- eng/pipelines/templates/stages/cleanup-acr-images.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/pipelines/templates/stages/cleanup-acr-images.yml b/eng/pipelines/templates/stages/cleanup-acr-images.yml index eb2034e79..4260a8d35 100644 --- a/eng/pipelines/templates/stages/cleanup-acr-images.yml +++ b/eng/pipelines/templates/stages/cleanup-acr-images.yml @@ -27,6 +27,9 @@ stages: - template: /eng/docker-tools/templates/steps/reference-service-connections.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} + usesRegistries: + - ${{ parameters.publishConfig.BuildRegistry.server }} + - ${{ parameters.publishConfig.PublishRegistry.server }} serviceConnections: - ${{ parameters.publishConfig.cleanServiceConnection }} - template: /eng/docker-tools/templates/steps/clean-acr-images.yml@self