The Atlas MikeAzureDev's documentation, bound to its code
140 documents

From Bicep to a running deployment

The infrastructure model end to end — network, compute, secrets — then the runbook that turns it into a live environment and the migration job that seeds the schema.

Decision

Hybrid model.

  • Azure Key Vault is the system of record for sensitive, long-lived secrets:
    • postgres-admin-password (replaced by MI auth in the EntraID phase)
    • postgrest-jwt-secret
    • openai-api-key, anthropic-api-key
    • r2-access-key-id, r2-secret-access-key
  • Native Container Apps secrets for Container Apps' own bookkeeping where Key Vault is overkill: image registry passwords (where MI pull from ACR is not used), short-lived rotation tokens.
  • Plain env vars for non-sensitive config (the URL of the internal PostgREST service, log level, the NODE_ENV value, etc.).

Each Container App and the migration job has a system-assigned Managed Identity. Each MI is granted the Key Vault Secrets User role on the vault. Container Apps' secrets block uses keyVaultUrl references that resolve at runtime; rotated secret versions are picked up on next pull without redeploying the app.