This project demonstrates how to deploy a Python-based web application across a scalable Virtual Machine Scale Set (VMSS) with automated load balancing and health monitoring using Microsoft Azure.
- Resource Group:
GL-VMSS-RG
- Scale Set Name:
gl-vmss-tio
- Region: East US
- VM Image: Ubuntu Server 22.04 LTS
- Instance Type: Standard_DC1s_v2
- Authentication: SSH key pair (
gl-vmss_key
) - Load Balancer:
GL-VMSS-LB
- App Port: HTTP (80)
- Admin Port: SSH (22)
- Public IP:
4.255.99.121
- Availability Zones: Zones 1, 2, and 3 for resilience
- Autoscaling Rules:
- Increase instance count by 1 when CPU > 80% for 10 mins
- Decrease instance count by 1 when CPU < 20% for 10 mins
- Health Probes: HTTP check on
/health.html
- Custom Script:
#!/bin/bash APP_NAME=LiftShift-Application apt update -y && apt -y install python3-pip zip cd /opt wget https://d6opu47qoi4ee.cloudfront.net/loadbalancer/simuapp-v1.zip unzip simuapp-v1.zip rm -f simuapp-v1.zip sed -i "s=MOD_APPLICATION_NAME=$APP_NAME=g" templates/index.html pip3 install -r requirements.txt nohup python3 simu_app.py >> application.log 2>&1 &
- Virtual Network:
GL-VMSS-RG-vnet
- NIC:
GL-VMSS-RG-vnet-nic
- Inbound Rules:
Port_80
: HTTP traffic (Priority 100)Port_22
: SSH access (Priority 110)
Once deployed, you can access the LiftShift-Application via the public IP:
http://4.255.99.121
Successful deployment displays the application frontend. Health probe status confirms load balancer routing is operational.
To remove resources post-validation:
# In Azure Portal
Search: Resource Groups → Select `GL-VMSS-RG` → Delete