Project · Architecture
Highly available web app on Azure
A web tier that keeps serving when a server — or a whole availability zone — fails. Everything is Terraform, and every change is formatted, validated, linted, security-scanned and priced before it can deploy.
Terraform · Standard Load Balancer · VM Scale Set · Availability Zones · Autoscale · Azure Monitor · GitHub Actions (OIDC)
- Servers
- 3+, one per zone
- Survives
- A datacenter failure
- Scaling
- Autoscale 3–10 on CPU
- Entry
- Load balancer only
The flow
From a visitor to a healthy server.
- 1Visitors hit one static, zone-redundant IP.
- 2The load balancer only sends traffic to servers that pass the
/healthprobe. - 3Servers sit in three zones. If a whole zone fails, the other two keep serving, and a failed server is replaced automatically.
- 4Autoscale adds servers above 70% CPU, up to 10.
- 5Azure Monitor watches the metrics and emails the admin.
Key decisions
Every choice has a reason.
- Availability zones, not an availability set. A set protects one datacenter; zones survive a whole datacenter failing.
- Scale set, not standalone VMs. Autoscale, rolling patches, self-healing and automatic load-balancer membership come built in.
- Standard Load Balancer. Basic is retired; Standard is zone-redundant and closed by default.
- Load balancer outbound rule, not NAT Gateway. Servers only go out for OS updates, so there's no need for the extra cost.
- No public IPs on the servers. The load balancer is the only way in; the NSG allows only 80/443.
- Encryption at host. The temp disk and host caches are encrypted too, not just the disks at rest.
Delivery
From commit to cloud, safely.
A GitHub Actions pipeline runs on every change: format, validate, lint, security scan (Checkov) and a cost estimate (Infracost). It deploys with OIDC — no stored password, nothing to leak. Terraform state lives in Azure Storage with Entra ID auth and a blob lease for locking, and the reviewed plan is exactly what gets applied.