Deploy a website across two Azure regions (Central US, West US) with traffic distribution using Traffic Manager. The site includes:
- Home Page (VM2)
- Upload Page (VM1, files uploaded to Azure Blob Storage)
- Error Pages (403, 502 errors via Azure Storage static site)
- VMs in VNets: Deployed in both regions, connected via VNet Peering.
- Application Gateway: Routes traffic to correct pages, handles errors.
- Blob Storage: Hosts static
error.html
, stores uploaded files. - Traffic Manager: Routes traffic between both regions' gateways.
- Create VM1 (Upload Page) and VM2 (Home Page) in each region.
- Peer VNets between regions.
Clone the repo on both VMs:
git clone https://github.com/azcloudberg/azproject
Run setup scripts:
VM1 (Upload Page): ./vm1.sh
VM2 (Home Page): ./vm2.sh
3. Configure Blob Storage & Gateway
Blob Storage: Create a storage account, enable static site, upload error.html. Create an upload container for file uploads.
Application Gateway: Route example.com to VM2 (home) and example.com/upload to VM1 (upload). Set error handling to point to the error.html.
4. VM1 Configuration
Update config.py with your Storage Account details, then start the app:
bash
Copy code
sudo python3 app.py
5. Traffic Manager
Configure Traffic Manager to distribute traffic between both regions.
6. Verify
example.com for the home page.
example.com/upload to test uploads.
Test error handling for 403/502 errors.
This project is given by Intellipaat.