fix: reauthenticate before deployment stack retries - #143
Open
RISHABHJAIN27 wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Refreshes Azure authentication before deployment stack retry attempts to avoid failures when long-running deployments outlive the initial Azure OIDC-authenticated session.
Changes:
- Propagates
AZURE_CLIENT_IDandAZURE_TENANT_IDinto the deploy job environment in the CD workflow template. - Adds retry-time OIDC token acquisition +
Connect-AzAccountreauthentication logic to the bicep deployment composite action. - Passes
AZURE_CLIENT_ID/AZURE_TENANT_IDthrough the action’s step environment for use during retries.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| alz/github/actions/bicep/templates/workflows/cd-template.yaml | Exposes Azure identity variables to the deploy job environment for downstream action use during retries. |
| alz/github/actions/bicep/templates/actions/bicep-deploy/action.yaml | Reauthenticates to Azure via fresh GitHub OIDC token on deployment stack retry attempts; forwards Azure identity env vars into the action runtime. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
reasonable improvement Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: RISHABHJAIN27 <[email protected]>
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.
Fixes #4209
Summary
Long-running deployment stack operations can outlive the Azure authentication context established at the start of the deployment workflow. This change refreshes Azure authentication before deployment stack retry attempts using a fresh GitHub OIDC token.
Changes
Workflow Template
Updated:
alz/github/actions/bicep/templates/workflows/cd-template.yamlAdded:
AZURE_CLIENT_IDAZURE_TENANT_IDto the deploy job environment so they can be used by the deployment action during retry operations.
Deployment Action
Updated:
alz/github/actions/bicep/templates/actions/bicep-deploy/action.yamlAdded retry-time reauthentication logic that:
Connect-AzAccountwith federated credentials.Validation
-Existing retry behavior is preserved when re-authentication is not performed.
`