← Back to list

πŸš€ 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.

Manish Gantyala Β· 2026-03-19 23:13 Β· 0 claps Β· 2.6 min read
#microsoft-azure #3-tier-architecture #load-balancer #devops #nsg
Open on Medium β†—
Wiki topics: 🌐 Β· Web Development ☁️ Β· DevOps & Cloud πŸ›οΈ Β· Architecture

πŸš€ 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 localhost instead 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/api paths

πŸ” 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

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