← Back to list

Design a Three-Tier Network with Load Balancer on Azure

VNet CIDR: 10.0.0.0/16 (example from sheet)

Bhupendra Bhati · 2025-10-03 16:43 · 103 claps · 11.2 min read
#azure #3-tier-architecture #web-app-development #azure-vm #azure-load-balancer
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud 🏛️ · Architecture

Design a Three-Tier Network with Load Balancer on Azure

  • VNet CIDR: 10.0.0.0/16 (example from sheet)
  • Web Subnet: 10.0.1.0/24
  • App Subnet: 10.0.2.0/25
  • DB Subnet: 10.0.3.0/26

Tasks Watch step by step guide here

Step 1: Create a Resource Group

  • Name: vnet-ha
  • Region: (Asia pacific) Central India

Step 2: Create a Virtual Network

  • Name: eb-demo-vnet
  • CIDR: 10.0.0.0/16

  • Enable Azure Bastion (optional, but recommended for private VM access later)

Note: Bastion will auto-create its own subnet (AzureBastionSubnet)

Create the following subnets inside the VNet:

Subnet Name

Address Range

web-subnet

10.0.1.0/24

app-subnet

10.0.2.0/25

db-subnet

10.0.3.0/26

Here we are creating the web subnet. There is a default subnet and we will click on the “pencil” icon to edit it. We will give it name “eb-demo-subnet-web-1”, now we will change the CIDR range “10.0.0.0/16” the starting address will be “10.0.0.0” and size we will choose “/24 (256 addresses)”, and we will save it.

Now we will add another subnet name: “eb-demo-subnet-app-1”, we will follow the same steps for IP settings.

Now we will enable private subnet by checking the box in Private subnet. We can see that in the image below, in the Security there is an option for NAT gateway, so we will create a new one. Another small window will open and we will configure it accordingly.

We will give it the name “eb-nat”, in the Public IP address we will choose “(New) eb-demo-subnet-app-1”, the public IP prefix will be NONE and we will save it.

We can see that the NAT is configured now we will click on ADD button and it will be added in our Subnet list.

Now we will create database subnet with the name “eb-demo-subnet-db-1” IP range will be “10.0.0.0/16”, starting address will be “10.0.3.0” and the size here we will choose “/26(64 addresses)” and we will click on ADD button to add it in our subnet list.

We have configured 3 subnets and we will use them accordingly. Now we can see that all the subnets we have created are present in our subnet list.

Finally we can see our subnets in the below image.

We can see that there is another subnet named “AzureBasionSubnet”, it is there because we have created the Basion host previously and we have chosen automatic subnet creation there that’s why we are seeing this here.

Now we will click on next and it will validate as we can see in the below image our validation got passed. So now we will create it.

As we will click on the create button it will start creating all the resources we have configured for creation. And, Yes, in the below image we can see it happening.

Step 3.1: Create a VM in the Web Subnet

  • We are creating a virtual machine now and we gave it the name: web-nginx. It is in our resource group vnet-ha, and the region will be same as we chose before.

  • Now we will choose Availability Zone: Zone1 and OS image: Ubuntu 24.04 LTS, we can see it in the image below.

  • For authentication we will choose a username/password, in my case the username is “bhupendra” and password is (it’s secret) 🙂 can’t share. We will enable the ports HTTP(80) and SSH(22) both. We will click on Next and for the disk all things are set so we will go further in Networking.

  • Our Virtual Network is eb-demo-vnet and we will choose the subnet eb-demo-subnet-web-1 (10.0.0.0/24).

  • Assign a Public IP & Allow inbound ports: SSH (22) and HTTP (80) Public IP we will choose (new) web-nginx-ip, NIC web security group we will choose Basic and we will select inbound ports HTTP(80) and SSH(22), we can see this in the image below.

Now we will click on create and it will start creating a VM with the configuration we have set. We can see the process in the below image.

Step 3.2: Create a VM in the App Subnet

We will create a VM for our App subnet. Steps are similar as done in the previous one. Name: app-nginx

Availability Zone : Zone1

Image : Ubuntu 24.04 LTS

Username : bhupendra

Password : It’s secret 🙂

Inbound Ports : HTTP(80)

SSH(22)

We will choose the subnet for app-nginx VM will be eb-demo-subnet-app-1.

Public IP : None

Security Group : Basic

Inbound Ports : HTTP (80)

SSH (22)

Now we will click on create and it will allocate the resources.

Step 3.3: Install Nginx in web-nginx VM in eb-demo-subnet-web-1 subnet.

Now we will go to the resource group and we will click on web-nginx vm.

After clicking on it we can see that we are in the VM and we can see the configuration of the VM, as shown in the image below.

Now we will copy the IP address which is 20.197.40.162, and we will go to the left pan there we will click on Settings →Connect .

We can see the Two options to connect with VM.

Now we use the Username and Password we have set while creating VM.

Username is : bhupendra

Password is : 🙂 (It’s a secret)

As I have entered both we will be entering our VM.

And yes. We are in. We can see in the image below.

Step 4.1: Install and Configure NGINX

Now we will install and configure the nginx. First we need to update the VM so we will run the commands:

sudo apt update -y // Update the VM.

This command updates our system’s package index with the latest information from repositories, and it does so automatically without asking for confirmation.

sudo apt install -y nginx // Install the nginx server

This command installs the Nginx web server on our system, “-y” ensuring that the installation runs automatically without needing manual confirmation.

Using this we have installed the nginx into our VM and now we will check the status of nginx whether it’s running or not.

sudo systemctl status nginx // If it is stopped we will start it.

This command will show the status of nginx whether it is running or not.

sudo systemctl enable nginx // We will enable it.

We use this command so that if our VM restart or reboot, there is no need to start the nginx server again using command. It will automatically start.

sudo systemctl start nginx // We will start the nginx server.

This is the command to start the nginx server if it is not start.

Here we can see the commands we have run in our VM.

Here we are checking the status of nginx.

Verify by visiting:

http://<VM Public IP> → You should see the NGINX default page.

Our Public IP is 20.197.40.162

So we will go to the browser and open the new tab and go to the web link :

http://20.197.40.162 and bingo, We can see our page in the browser and its working.

Now we will delete the VM web-nginx, for that we will click on Delete as we can see in the below image.

After this our VM will delete.

Step 4.2: Install and Configure NGINX in “app-nginx” VM.

We will go to the app-nginx and then we will go to the left panel and we will go to Connect and we will click on “Go to Bastion”.

Now we will provide the Username and Password which we have set during VM creation. As we will click on Connect we will land to our VM.

We will follow the same steps as we did in **Step 4.1**

sudo apt update -y

sudo apt install nginx -y

sudo systemctl status nginx

We can see that the server is running in our VM app-nginx.

Step 5: Create a Public Load Balancer.

  • Now we will create a loadbalancer. We will search for loadbalancer and we will click on create and select “Standard Load balancer” further we will configure it. Name: nginx-lb

  • Region : same as VNet
  • SKU : Standard
  • Type : Public
  • Tier : Regional

Now we will configure the Frontend IP. We will click on “Add a frontend IP Configuration” the page will open as below.

We will give it the name nginx-lb. In the Public IP address we will click on Create New and again a new section will open and we will name it nginx-frontend-ip we will click on Save. It will looks like below image.

Now everything is set and we will click on Save.

We can see our nginx-lb is listed in the dashboard.

Now we will click on Next to set up the Backend Pool.

  • Backend pool:
  • Name: app-backend-pool
  • Adding our web-nginx VM (by IP or NIC): 10.0.2.4

We are having Backend Address name then IP we have set to 10.0.2.4 and Resource name is there app-nginx(vnet-ha).

Now we will save it and we will move to the next step which is adding the new load balancer rule.

Adding a load balancer rule, we will configure it as follow: a) Bastion Basic or Standard b) Native SSH So we will click on “Go to Bastion”

Name : lb-rules frontend IP : nginx-lb Backend Pool : app-backend-pool Protocol : TCP

Health Probe : We will create a new health probe. So click on Create New.

  • Health probe:
  • Name: http-health-check
  • Protocol: TCP
  • Port: 80
  • Interval: 5 seconds

We will now Save this configuration as we can see in the image below…

  • Load balancing rule:
  • Name: lb-rules
  • Frontend: nginx-lb
  • Backend: app-backend-pool
  • Protocol: TCP
  • Port: 80 → Backend port: 80

Now we will save this rule with the above configuration.

We will click on next and we can see it Validated.

Now we will click on create and we can see in the below image resources are getting provisioned.

Now in the left panel we will go to Settings and we will click on “Frontend IP Configuration”. There we will see the nginx-lb load balancer and we will copy the public IP as we can see in the below image.

The public IP is : 4.187.216.79

Now we will go to the web browser and we will use this IP to check whether we can access our nginx server or not.

http://4.187.216.79

Step 6: Test the Architecture

  • We will open our browser and go to: http://4.187.216.79
  • We can see the same NGINX default page.

So we can see that we use the load balancer instead of VM public IP to access the nginx default page.

We have configured so many things during this hands-on so now we will move further to clean the environment.

Step 7: Clean Up Resources

To avoid charges, delete everything:

  1. Go to your Resource Group vnet-hg

When we choose our resource group we can see all the resources we have provisioned are present there.

  1. Click Delete resource group

To make it clean or we can say to delete all the resources we will delete the resource group so that all the services attached to this resource group will be deleted.

When we type the resource name and click on delete it will start the process to delete the resources .

  1. Type the name to confirm and we are done. We can see the below image resources are getting deleted.

The below image confirms that the resources are deleted.

So we get experience on how to create subnets, VM, Network and how to access the web service which is installed in the VM using the load balancer.


메타데이터
post_id
5cd6730743b9
slug
design-a-three-tier-network-with-load-balancer-on-azure-5cd6730743b9
url
https://medium.com/@bhupendrabhati/design-a-three-tier-network-with-load-balancer-on-azure-5cd6730743b9
canonical_url
https://medium.com/@bhupendrabhati/design-a-three-tier-network-with-load-balancer-on-azure-5cd6730743b9
author_url
https://medium.com/@bhupendrabhati
status
ok
fetched_at
2026-07-13 12:04:51