[P1] ci-cd: retry path misses ACA state adoption after first failed provision attempt
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- azure, github-actions, terraform
- Domain
- ci-cd, cloud, devops, infrastructure
Research direction
Start with .github/workflows/azd-deploy.yml, the provision job, and its reconcile step. Review the failed run and Terraform state-adoption behavior around retrying Provision infrastructure, including the reported ARM eventual-consistency case. Done means each retry reports imported or skipped ACA apps and avoids already-exists failures in a fresh environment.
Written by the indexing model from the issue text.
Description
Problem
azd-deploy fails in a brand-new environment because retry attempt 2 tries to create ACA apps that already exist in Azure but are not present in Terraform state at that moment.
Type
- bug
- regression
Evidence
- Workflow run: https://github.com/Azure-Samples/tutor/actions/runs/23124471384
- Job:
provision(67164738583), stepProvision infrastructurefailed. - Same run shows:
- attempt 1 transient ACA errors (
Operation expired), then retry - attempt 2 errors:
already exists - to be managed via Terraform this resource needs to be imported into the Statefor multiple apps (avatar/chat/configuration/essays/evaluation/lms-gateway/questions/upskilling).
- attempt 1 transient ACA errors (
- Earlier in same job, reconcile step logged several
not found in Azure. Skipping state import.for those apps before attempt 1.
Reproduction
- Trigger
.github/workflows/azd-deploy.ymlwithworkflow_dispatchandazure_env_name_override=178dev(or any fresh dev env). - Allow first
Provision infrastructureattempt to hit transient ACA revision failures. - Observe retry attempt where Terraform reports
already existson ACA apps.
Acceptance Criteria
- Before each provision retry, the workflow deterministically imports any ACA app that exists in Azure and is missing from state.
- State-adoption check includes bounded polling to handle ARM eventual consistency after failed attempt 1.
- Retry attempt 2 no longer fails with
already existsfor ACA backend apps in fresh env scenarios. - Add a step summary block that reports imported/skipped apps per retry for diagnostics.
Suggested Owner
platform-quality
- Dominant language
- Python
- Stars
- 17
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure-Samples/tutor
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure-Samples/tutor#230 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Azure-Samples/tutor#229 · 1 comment ·
-
frontend priority:P2 type:tech-debt
Difficulty 5/5 Over a week Newbie friendliness 35/100
Azure-Samples/tutor#224 · 3 comments ·
-
component:ci-cd frontend priority:P1 type:tech-debt
Difficulty 5/5 Over a week Newbie friendliness 35/100
Azure-Samples/tutor#223 · 2 comments ·
-
frontend priority:P1 type:feature
Difficulty 5/5 Over a week Newbie friendliness 30/100
Azure-Samples/tutor#222 · 1 comment ·
All issues in Azure-Samples/tutor
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100