Governance Anti Patterns Containers - Azure/az-prototype GitHub Wiki
Container Apps, ACR, and container runtime configuration detection
Domain: containers
| Check | Description |
|---|---|
| ANTI-CONT-001 | Secret in environment variable — use Key Vault references with managed identity instead. |
| ANTI-CONT-002 | Container registry admin user enabled — disable admin and use managed identity with AcrPull role. |
| ANTI-CONT-003 | Container App needs UserAssigned identity (or SystemAssigned,UserAssigned) for ACR image pull — SystemAssigned alone fails on first deploy. |
| ANTI-CONT-004 | Container image uses :latest tag — use a specific version tag or SHA digest for reproducible deployments. |
Secret in environment variable — use Key Vault references with managed identity instead.
Rationale: Plain environment variables expose secrets in Container App revision metadata and ARM deployment history.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|
Container registry admin user enabled — disable admin and use managed identity with AcrPull role.
Rationale: Admin credentials are shared secrets that cannot be scoped per-service; managed identity with AcrPull provides per-identity audit.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|
Container App needs UserAssigned identity (or SystemAssigned,UserAssigned) for ACR image pull — SystemAssigned alone fails on first deploy.
Rationale: SystemAssigned identity alone causes image pull failures on first provision because the identity doesn't exist when ACR pull is attempted.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|
Container image uses :latest tag — use a specific version tag or SHA digest for reproducible deployments.
Rationale: The :latest tag is mutable and non-deterministic — different nodes may pull different images, causing inconsistent behavior.
Agents: terraform-agent, bicep-agent
| Services | Triggers On | Correct Patterns |
|---|---|---|
|
|
|