π Building a 3-Tier Web Application on Azure β My Hands-On Journey
When I started this project, my goal was simple: π Understand how real-world applications are deployed in the cloud.
π Building a 3-Tier Web Application on Azure β My Hands-On Journey
When I started this project, my goal was simple: π Understand how real-world applications are deployed in the cloud.
But as I went deeper, I realized this wasnβt just about deploying an app β it was about designing, debugging, and thinking like a Cloud/DevOps engineer.
π± Getting Started
I began by planning the architecture. The application follows a 3-tier structure:
- Web Layer (Frontend)
- Application Layer (Backend)
- Database Layer
To implement this on Azure, I first created a Virtual Network (VNet) with the address space:
10.0.0.0/16
Then, I divided it into 6 subnets:
- Web Tier β
10.0.1.0/24,10.0.2.0/24 - App Tier β
10.0.3.0/24,10.0.4.0/24 - DB Tier β
10.0.5.0/24,10.0.6.0/24
This separation helped me clearly isolate each layer.
π Securing the Architecture
Next, I configured Network Security Groups (NSGs) to control traffic:
- Web Tier β allowed HTTP (80) and SSH (22)
- App Tier β allowed traffic only from Web Tier on port 3001
- DB Tier β allowed MySQL (3306) only from App Tier
This was my first real understanding of how secure communication works between layers.
βοΈ Setting Up Compute & Database
After networking, I moved to compute:
- Created a Web VM (public) for frontend
- Created an App VM (private) for backend
- Set up Azure MySQL (Flexible Server) in private subnet
For outbound access from private VM, I configured a NAT Gateway.
π Load Balancers β Making It Real
This is where things started to feel like real production architecture:
- Public Load Balancer β handles incoming user traffic
- Internal Load Balancer β routes traffic to backend
Flow looked like this:
User β Public LB β Web VM β Internal LB β App VM β Database
π Deploying the Application
I deployed:
- Frontend β Next.js (running behind Nginx on port 80)
- Backend β Node.js (running on port 3001)
- Process Manager β PM2
Nginx acted as a reverse proxy, forwarding:
/β frontend/apiβ backend via internal load balancer
π§ Challenges I Faced
This is where the real learning happened.
Things didnβt work smoothly at all π
- Nginx showed default page instead of my app
- APIs were failing with 504 Gateway Timeout
- Books were not loading
- Some requests returned 404 errors
- Frontend was calling
localhostinstead of backend
At one point, everything looked correct, but nothing worked.
π οΈ How I Solved It
Instead of guessing, I started debugging step by step:
π 1. Tested backend directly
curl http://localhost:3001/api/books
π Confirmed backend is working
π 2. Checked connectivity between layers
- Verified Web VM β App VM communication
- Fixed NSG rules (allowed port 3001)
π 3. Fixed Nginx routing
Updated config to correctly forward /api requests to Internal Load Balancer.
π 4. Fixed frontend API issues
- Removed
localhost - Used
/api/...routes - Avoided duplicate
/api/apipaths
π 5. Rebuilt frontend properly
npm run build
pm2 restart frontend
π Final Result
After fixing everything:
- App loaded successfully through Public Load Balancer
- Backend worked via Internal Load Balancer
- Database connected securely
- Users could register, login, and view books
That moment when everything workedβ¦ π honestly felt like a big achievement π₯
π‘ Key Learnings
This project changed how I see development:
- Itβs not just about writing code
- Networking and configuration matter equally
- Debugging is the most important skill
- Small mistakes (like wrong API path) can break everything
Most importantly:
π Real learning happens when things donβt work.
π Final Thoughts
This project gave me confidence that I can:
- Design cloud architecture
- Debug real-world issues
- Understand how applications run in production
And now, Iβm even more excited to explore Cloud and DevOps roles π

3 β Tier Architecuture Diagram for Book Review Application
P.S. This post is part of the DevOps Micro Internship (DMI) Cohort-2 by Pravin Mishra. You can start your DevOps journey by joining this Discord community ( https://discord.pravinmishra.com/ ).
λ©νλ°μ΄ν°
- post_id
- 4a8cdb1097f2
- slug
- building-a-3-tier-web-application-on-azure-my-hands-on-journey-4a8cdb1097f2
- url
- https://medium.com/@manish05.devops/building-a-3-tier-web-application-on-azure-my-hands-on-journey-4a8cdb1097f2
- canonical_url
- https://medium.com/@manish05.devops/building-a-3-tier-web-application-on-azure-my-hands-on-journey-4a8cdb1097f2
- author_url
- https://medium.com/@manish05.devops
- status
- ok
- fetched_at
- 2026-06-12 18:14:10