Skip to content

feat(infra): add Azure Terraform skeleton (mirror of gcp)#240

Merged
beenuar merged 1 commit into
mainfrom
feat/azure-terraform-skeleton
May 30, 2026
Merged

feat(infra): add Azure Terraform skeleton (mirror of gcp)#240
beenuar merged 1 commit into
mainfrom
feat/azure-terraform-skeleton

Conversation

@beenuar

@beenuar beenuar commented May 30, 2026

Copy link
Copy Markdown
Owner

Summary

Adds infra/terraform/azure/ — a serverless-container deployment skeleton for AiSOC on Azure, mirroring the existing infra/terraform/gcp/ Cloud Run stack file-for-file. Closes #237.

The stack provisions the api, web, and ingest services on Azure Container Apps (no Kubernetes), backed by managed Azure data + secret services on a private VNet:

Concern Azure resource GCP analog
Compute Container Apps (api/web/ingest) Cloud Run
Database PostgreSQL Flexible Server (private) Cloud SQL Postgres
Cache Azure Cache for Redis (private endpoint) Memorystore Redis
Secrets Key Vault (RBAC) Secret Manager
Registry Azure Container Registry Artifact Registry
Identity user-assigned managed identities service accounts
Networking VNet + delegated subnets + private endpoints Serverless VPC Access
Logs Log Analytics Workspace Cloud Logging

Files

  • main.tf — resource group, VNet (ACA + Postgres-delegated + PE subnets), Log Analytics, Container Apps environment, ACR
  • database.tf — PostgreSQL Flexible Server, private DNS zone, logical database
  • redis.tf — Azure Cache for Redis behind a private endpoint
  • secrets.tf — Key Vault (RBAC) + generated SECRET_KEY / AISOC_CREDENTIAL_KEY
  • iam.tf — user-assigned managed identities + AcrPull / Key Vault Secrets User roles
  • container_apps.tf — the three apps, Key-Vault-backed secret injection via managed identity
  • variables.tf / outputs.tf / versions.tf / terraform.tfvars.example
  • README.md — architecture, quickstart, state backend, container image, cost notes, known limits

Security notes

  • Sensitive values (SECRET_KEY, credential key, Postgres password, Redis key, optional OPENAI_API_KEY) are generated by Terraform and stored in Key Vault; apps read them at runtime via managed identity. No secrets land in tfvars or env blocks.
  • Postgres and Redis are private-only (private endpoints + private DNS); no public ingress on data services.
  • Emits the same env-var contract as the AWS/GCP stacks (apps/docs/docs/deployment/env-vars.md).

Also adds an Alternate cloud skeletons section to infra/terraform/README.md pointing at the GCP and Azure options.

Test plan

  • terraform fmt clean
  • terraform validate -> Success! The configuration is valid.
  • terraform plan against a real subscription (requires az login + subscription_id)
  • End-to-end apply in a scratch resource group
  • Confirm api/web/ingest boot and resolve Key Vault secrets via managed identity

Made with Cursor

Adds infra/terraform/azure/ provisioning the AiSOC api/web/ingest
services on Azure Container Apps, mirroring the GCP Cloud Run skeleton
file-for-file:

- main.tf        resource group, VNet (ACA + Postgres-delegated + PE
                 subnets), Log Analytics, Container Apps env, ACR
- database.tf    PostgreSQL Flexible Server, private DNS, logical db
- redis.tf       Azure Cache for Redis behind a private endpoint
- secrets.tf     Key Vault (RBAC) + generated SECRET_KEY / credential key
- iam.tf         user-assigned managed identities + AcrPull / KV roles
- container_apps.tf  api/web/ingest apps, KV-backed secret injection
- variables.tf / outputs.tf / versions.tf / terraform.tfvars.example
- README.md      architecture, quickstart, state backend, cost notes

Sensitive values are generated and stored in Key Vault and consumed by
the apps via managed identity (no secrets in tfvars). Emits the same
env-var contract as the AWS/GCP stacks.

Also documents the alternate cloud skeletons in infra/terraform/README.md.

Closes #237

Co-authored-by: Cursor <cursoragent@cursor.com>
@beenuar beenuar merged commit f953af4 into main May 30, 2026
23 checks passed
@beenuar beenuar deleted the feat/azure-terraform-skeleton branch May 30, 2026 02:25
@beenuar beenuar mentioned this pull request May 30, 2026
4 tasks
beenuar pushed a commit that referenced this pull request May 31, 2026
The Azure Container Apps + Postgres Flexible Server skeleton landed in
#240 (mirror of the GCP skeleton), but the README's "Stage 2 / Stage 3
platform additions" sections and the Docusaurus deployment docs were
never updated to mention it. Visitors comparing cloud options see only
AWS (top-level infra/terraform) and GCP (infra/terraform/gcp + a docs
page) and assume Azure isn't supported.

- README.md: add an Azure bullet directly after the existing GCP bullet
  in both the recent-additions section and the older changelog block,
  noting Container Apps, VNet-private Postgres + Redis, Key Vault, ACR,
  and per-service managed identities.
- apps/docs/docs/deployment/azure.md: new page that mirrors gcp.md
  section-for-section (overview, prerequisites, quick start, container
  images, connecting to Postgres, secrets, costs, limitations,
  tear-down, see-also). Content is grounded in the actual files under
  infra/terraform/azure/ — same `terraform.tfvars.example` keys, same
  output names, the real Key Vault soft-delete-with-purge behaviour.
- apps/docs/sidebars.ts: add deployment/azure right after deployment/gcp
  so it appears in the docs sidebar.
- apps/docs/docs/deployment/gcp.md: add a reciprocal "Azure skeleton"
  link in the See-also section for symmetry.

No Terraform code changes — this is documentation only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Azure Terraform skeleton (mirror of infra/terraform/gcp/)

1 participant