Azure / Azure/bicep

Detect likely what-if failure and warn appropriately

Open
#10,182 6 comments 3 reactions 1 assignee Claimed by @alex-frankel View on GitHub
revisit
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
Bicep CLI version 0.15.31 (3ba6e06a8d)

**Describe the bug**

The upstream issue https://github.com/Azure/arm-template-whatif/issues/157 means that trivial/innocuous differences in template/module construction can turn normal/expected what-if output into output that is completely useless (i.e. changes to certain resources being ignored entirely).

It's not clear that that issue is likely to be addressed any time soon (looks to be 2+ years in the making). In the meantime, it would be great if bicep were to:

1. warn if the ARM it generates is likely to result in poor what-if output
2. even better, indicate what in the source bicep file(s) is likely causing the issue

For example, our most recent experience with this what-if failing was caused by simply passing `postgresql.properties.fullyQualifiedDomainName` to another module as a parameter value (where `postgresql` was a flexible server pg resource). This resulted in all "downstream" resources being ignored in what-if invocations, making that facility quite useless until I finally (through much squinting at ARM translations and reading the comments on https://github.com/Azure/arm-template-whatif/issues/157) identified the problematic reference and replaced it with passing the database's name instead (so the downstream module could obtain the fqdn from its own `existing` resource). _Any_ sort of feedback about the "problematic" (from ARM's perspective) reference would have probably helped avoid a _lot_ of lost time (probably close to 6 hours in this case).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.