[ACR] Fallback ACR token challenge handling for 403 responses without WWW-Authenticate#33460
Draft
Copilot wants to merge 3 commits into
Draft
[ACR] Fallback ACR token challenge handling for 403 responses without WWW-Authenticate#33460Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Copilot
AI
changed the title
[WIP] Fix az acr supply-chain workflow create command failure in Cloud Shell
[ACR] Fallback ACR token challenge handling for 403 responses without WWW-Authenticate
May 28, 2026
Collaborator
|
ACR |
Member
Live test results —
|
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.
Related command
az acr supply-chain workflow create --run-immediately trueDescription
Cloud Shell can return
403(withoutWWW-Authenticate) on initial registry challenge, which breaks auth negotiation for OCI artifact push flows that assume a401challenge header. This change adds a targeted AAD-only fallback so token exchange can proceed when that header is absent.Challenge handling hardening (
acr/_docker_utils.py)401/403only).is_aad_token=Trueand response is403with noWWW-Authenticate, synthesize token params using standard ACR endpoints (/oauth2/token,service=<login_server>).Behavioral coverage (
test_acr_commands_mock.py)get_access_credentialsfallback path on403without challenge header.403withWWW-Authenticate(normal parse path).403without challenge header.Testing Guide
az acr supply-chain workflow create ... --run-immediately truefrom Cloud Shell against a registry that returns403withoutWWW-Authenticateon initial challenge.History Notes
[ACR]
az acr supply-chain workflow create: add AAD token-challenge fallback when registry returns403withoutWWW-Authenticateduring OCI push auth negotiation.This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.