Highly Available 3-Tier Web Architecture
Combine your knowledge of Networking, Compute, Load Balancing, and Monitoring to build a resilient application environment that can survive an entire datacenter outage.
Phase 1: Foundational Networking
First, we need to create the boundaries for our application and properly segment the web traffic from the backend database traffic.
- Sign in to the Azure Portal and create a new Resource Group named
Contoso-App-RG. - Deploy a new Virtual Network named
App-VNetwith the address space10.5.0.0/16. - Create two distinct subnets within this VNet:
WebTier-Subnet(10.5.1.0/24)DBTier-Subnet(10.5.2.0/24)
- Deploy a Network Security Group (NSG) named
Web-NSG. Add an inbound rule allowing Port 80 (HTTP) from the internet. - Associate the
Web-NSGwith theWebTier-Subnet.
Phase 2: Traffic Management
We cannot have a highly available application if users are pointing directly to a single server's IP address. We need a Load Balancer to act as the single point of contact.
- Search for Load Balancers and create a new one named
App-LB. - Ensure you select the Standard SKU and Public type.
- Create a new Frontend Public IP address named
App-LB-PIP. - Once deployed, open the Load Balancer and create a Backend Pool named
Web-Servers-Pool. Select yourApp-VNet, but do not attach any Virtual Machines yet. - Create a Health Probe named
HTTP-Probechecking Port 80 every 5 seconds. - Create a Load Balancing Rule linking the Frontend IP, the Backend Pool, and the Health Probe over Port 80.
Phase 3: Scalable Compute (VMSS)
Now we deploy the actual servers. By using a Scale Set spread across Availability Zones, we protect against catastrophic facility failures.
- Search for Virtual Machine Scale Sets and create a new one named
Web-VMSS. - Choose
Windows Server 2022as the image. - Under the Availability zones setting, ensure Zones
1, 2, and 3are all checked. - Under the Networking tab, place the VMSS in the
App-VNetand theWebTier-Subnet. - Check the box to place instances behind a load balancer, and select the
App-LBandWeb-Servers-Poolyou created in Phase 2. - Under the Scaling tab, set the initial instance count to
2. Configure Custom auto-scaling to scale out (add 1 VM) if CPU exceeds 75%. - Click Review + Create to deploy the fleet.
Phase 4: Observability & Alerting
If half of our servers go offline, the Load Balancer will keep the app running, but as an administrator, you need to know a failure occurred.
- Navigate to the
App-LBLoad Balancer resource. - On the left menu, scroll down to Alerts and click
+ Create. - For the Signal, select Health Probe Status.
- Set the alert logic to trigger if the Average Health Probe Status is Less than 50%. (Meaning half your servers are failing the health check).
- In the Actions tab, select or create an Action Group to send an email to your administrative address.
- Name the alert rule
Critical: Web Tier Degradedand save it.
You have successfully engineered an enterprise-grade architecture. Users hit your Public Load Balancer, which routes traffic across a fleet of VMs spanning three different physical data centers. If traffic spikes, the set automatically grows. If a datacenter goes dark, the remaining zones handle the traffic, and Azure Monitor instantly emails you.