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.
Target architecture
Resource Group: rg-mike-<env>
VNet (10.0.0.0/16)
├─ subnet-cae (10.0.1.0/23) — Container Apps Environment
├─ subnet-pe (10.0.4.0/27) — Postgres Private Endpoint
└─ subnet-natgw (10.0.4.32/27) — NAT Gateway
Container Apps Environment (Consumption, VNet-integrated)
├─ app: backend (external ingress, scales 0→N)
├─ app: postgrest (internal ingress only, scales 0→N)
└─ job: db-migrate (manual/triggered, runs node-pg-migrate)
Postgres Flexible Server (NO public access)
└─ Private Endpoint → subnet-pe
└─ Private DNS Zone: privatelink.postgres.database.azure.com
Key Vault (db password, JWT secret, third-party API keys)
└─ Accessed via system-assigned MIs on each Container App + Job
NAT Gateway (stable egress IPs for OpenAI/Anthropic/R2)