@codemod/arm-redundant-resource-dependson
Remove redundant explicit dependsOn entries from Azure Resource Manager (ARM) JSON templates when the dependency is already implied by ARM evaluation semantics.
Installation
bash
Usage
This codemod targets ARM template .json files and removes dependsOn entries in two conservative cases:
- The resource already references the same template resource via
reference(...),references(...), or alist* (...)function call whose first argument is the sameresourceId(...)expression. - A nested child resource explicitly depends on its containing resource, even though that parent dependency is already implied by the nested resource relationship.
The codemod preserves dependsOn entries when it cannot prove the dependency is implicit. In particular, it leaves unrelated dependencies, non-resourceId(...) entries, and resources that only mention another resource ID as plain data unchanged.
Example:
json
Becomes:
json
Development
bash
License
MIT