Governance Anti Patterns Completeness - Azure/az-prototype GitHub Wiki
Structural gaps, incomplete scripts, and missing companion resources
Domain: completeness
| Check | Description |
|---|---|
| ANTI-COMP-001 | Local auth disabled but no managed identity or role assignment detected — include both when disabling local auth. |
| ANTI-COMP-002 | Deploy script uses lowercase color variables — use UPPERCASE (YELLOW, RED, GREEN, NC). |
| ANTI-COMP-003 | azurerm data source detected — use terraform_remote_state or input variables to reference prior-stage resources. |
| ANTI-COMP-004 | versions.tf detected — consolidate terraform {}, required_providers, and backend into providers.tf only. |
| ANTI-COMP-005 | Variable reference in backend block — backend blocks only support literal values, not variables. |
| ANTI-COMP-006 | Empty backend configuration values detected — provide literal values or use local backend. |
| ANTI-COMP-007 | Hardcoded resource name with naming convention prefix detected — use variables or remote state outputs. |
| ANTI-COMP-008 | Storage Blob Delegator role detected — use Storage Blob Data Contributor (ba92f5b4) for blob data access. |
| ANTI-COMP-009 | capacityMode does not exist in Cosmos DB ARM schema — use capabilities = [{ name = "EnableServerless" }] instead. |
| ANTI-COMP-010 | Use an azapi_resource for blobServices/default and reference its .id for diagnostic settings parent_id. |
| ANTI-COMP-011 | azapi_resource may be missing parent_id — every azapi_resource MUST have parent_id set. |
Local auth disabled but no managed identity or role assignment detected — include both when disabling local auth.
Rationale: Disabling local auth without providing an alternative identity causes authentication failures at runtime.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|
Deploy script uses lowercase color variables — use UPPERCASE (YELLOW, RED, GREEN, NC).
Rationale: Bash convention uses UPPERCASE for constants; lowercase color variables conflict with common variable names.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
| *All* |
|
|
azurerm data source detected — use terraform_remote_state or input variables to reference prior-stage resources.
Rationale: azurerm data sources require the azurerm provider which is not used in this project — use remote state or variables instead.
Agents: terraform-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
| *All* |
|
|
versions.tf detected — consolidate terraform {}, required_providers, and backend into providers.tf only.
Rationale: This project consolidates terraform {}, required_providers, and backend into providers.tf — a separate versions.tf causes confusion.
Agents: terraform-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
| *All* |
|
|
Variable reference in backend block — backend blocks only support literal values, not variables.
Rationale: Terraform backend configuration blocks cannot use variables, locals, or data sources — only literal values are supported.
Agents: terraform-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
| *All* |
|
|
Empty backend configuration values detected — provide literal values or use local backend.
Rationale: Empty backend configuration values cause Terraform init failures or silent fallback to defaults.
Agents: terraform-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
| *All* |
|
|
Hardcoded resource name with naming convention prefix detected — use variables or remote state outputs.
Rationale: Hardcoded names with zone prefixes (zd-, pm-, pc-) break when naming conventions change or resources are reused across environments.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
| *All* |
|
|
Storage Blob Delegator role detected — use Storage Blob Data Contributor (ba92f5b4) for blob data access.
Rationale: Storage Blob Delegator only grants User Delegation Key access — applications need Storage Blob Data Contributor for actual blob read/write.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|
capacityMode does not exist in Cosmos DB ARM schema — use capabilities = [{ name = "EnableServerless" }] instead.
Rationale: The Cosmos DB ARM schema does not have a capacityMode property. Setting it is silently ignored and serverless mode is not activated.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|
Use an azapi_resource for blobServices/default and reference its .id for diagnostic settings parent_id.
Rationale: String interpolation for ARM child resource IDs is fragile and breaks when the resource ID format changes.
Agents: terraform-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|
azapi_resource may be missing parent_id — every azapi_resource MUST have parent_id set.
Rationale: The azapi provider requires parent_id on all resources. Omitting it causes terraform plan failure. For resource groups, parent_id is /subscriptions/${var.subscription_id}. For child resources, parent_id is the parent resource ID.
Agents: terraform-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|