Implicit dependencies not consistenly waited for
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 79
Description
**Bicep version**
`Using Bicep v0.25.53`
**Describe the bug**
In the AVM CI, we see an increasing amount of deployments that fail because implicit dependencies are not being waited for consistently. (See below example). Adding an explicit dependency 'seemed' to have fixed the issue.
**To Reproduce**
Steps to reproduce the behavior:
- I guess you could try and deploy, for example, [this commit version](https://github.com/Azure/bicep-registry-modules/blob/b86b2db16fe5c8ec9d97b8e0aaf44d1a052394cd/avm/res/batch/batch-account/tests/e2e/max/main.test.bicep) of a module test
- In our case it's enough to run our deployment tests for AVM modules as it fails quite often
- However, it is not consitent. For example, the below shown [Batch Account test](https://github.com/Azure/bicep-registry-modules/actions/runs/8053251967/job/21995269240) shows the 'max' test failing, yet the 'waf-aligned' worked even though both do have implicit dependencies.
**Additional context**
Here is an example from one of our test pipelines (but I'll link more for reference). As you can see, the ARM log shows that the dependencies deployment is running, yet it doesn't wait for a 'succeeded' before continuing and deploying the resource that needs the references:

Yet there should be an implicit dependency:

I did see this behavior for many deployment tests and can only say that it definitely seems to wait for the resource group (if any). Other contributors described the same (inconsistent) behavior.
For reference
| Pipeline Run | Module Code |
| - | - |
| [run](https://github.com/Azure/bicep-registry-modules/actions/runs/8053251967/job/21995268990#step:4:586) | [code](https://github.com/Azure/bicep-registry-modules/blob/b86b2db16fe5c8ec9d97b8e0aaf44d1a052394cd/avm/res/batch/batch-account/tests/e2e/max/main.test.bicep) |
| [run](https://github.com/Azure/bicep-registry-modules/actions/runs/8053251956) | [code](https://github.com/Azure/bicep-registry-modules/blob/b86b2db16fe5c8ec9d97b8e0aaf44d1a052394cd/avm/res/automation/automation-account/tests/e2e/max/main.test.bicep) |
| [run](https://github.com/Azure/bicep-registry-modules/actions/runs/8053252156/job/21995298507) | [code](https://github.com/Azure/bicep-registry-modules/blob/b86b2db16fe5c8ec9d97b8e0aaf44d1a052394cd/avm/res/container-registry/registry/tests/e2e/waf-aligned/main.test.bicep) |
Contributor guide
Research direction
Start with the referenced end-to-end tests at avm/res/batch/batch-account/tests/e2e/max/main.test.bicep and the other linked module test paths, then run the AVM deployment tests to reproduce the intermittent failure. Compare the failing max test with the working waf-aligned test and inspect the ARM deployment logs. Done means implicit dependencies are consistently awaited before dependent resources deploy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100