19 ‐ Application_Gateway_In_Azure - SanjeevOCI/Azure GitHub Wiki

🌐 Application Gateway in Azure

This lab demonstrates the steps to set up an Azure Application Gateway, including the creation of necessary resources and configuration of a backend web server.


🧱 Prerequisites

  • An active Azure subscription
  • Basic understanding of Azure networking components

🔹 Step 1: Create a Resource Group

  1. Navigate to the Azure Portal.
  2. Search for Resource groups and click + Create.
  3. Fill in the required details:
    • Subscription: Select your subscription.
    • Resource Group: Enter a name (e.g., AppGatewayRG).
    • Region: Choose a region (e.g., East US).
  4. Click Review + Create, then Create.

📷 *Refer to Screenshot: 18_Application_Gateway_Azure_1


🔹 Step 2: Create a Virtual Network and Subnets

  1. In the Azure Portal, search for Virtual networks and click + Create.
  2. Fill in the required details:
    • Name: Enter a name (e.g., AppGatewayVNet).
    • Address space: Define the address space (e.g., 10.0.0.0/16).
  3. Under Subnets, create two subnets:
    • AppGatewaySubnet: e.g., 10.0.1.0/24
    • BackendSubnet: e.g., 10.0.2.0/24
  4. Click Review + Create, then Create.

📷 *Refer to Screenshot: 18_Application_Gateway_Azure_2


🔹 Step 3: Create a Virtual Machine

  1. Navigate to Virtual machines and click + Create.
  2. Fill in the required details:
    • Name: Enter a name (e.g., BackendVM).
    • Region: Same as the Resource Group.
    • Image: Choose a Linux distribution (e.g., CentOS).
    • Size: Select an appropriate size.
    • Authentication type: Choose SSH public key or password.
    • Inbound port rules: Allow HTTP (80) and SSH (22).
  3. Under Networking, place the VM in the BackendSubnet of AppGatewayVNet.
  4. Click Review + Create, then Create.

📷 *Refer to Screenshot: 19_Application_Gateway_Azure_3

After creating the VM, we need to follow the below steps :

  1. Login to the VM and sudo to root.
  2. Install and Enable httpd service in VM.
  3. Create an index file (/var/www/html/index.html)
  4. Enable firewalld service in VM.
  5. Add port 80 in firewall.

19_Application_Gateway_Azure_4

19_Application_Gateway_Azure_5

19_Application_Gateway_Azure_6

19_Application_Gateway_Azure_7

19_Application_Gateway_Azure_8

19_Application_Gateway_Azure_9

19_Application_Gateway_Azure_10

19_Application_Gateway_Azure_11

19_Application_Gateway_Azure_12

19_Application_Gateway_Azure_13

Ensure that index.html is accessible on web

19_Application_Gateway_Azure_14

Create a Public IP Address

Create a Public IP for the Application Gateway.

19_Application_Gateway_Azure_15

Create Application Gateway

Now we have have to create the Application Gateway , Fill the Basic Part.

19_Application_Gateway_Azure_16

In the Frontends section, select the Public IP

19_Application_Gateway_Azure_17

In the Backends section, Click on Add a Backend Pool

19_Application_Gateway_Azure_18

Fill the below details and click on Add

19_Application_Gateway_Azure_19

Now we can see the backend pool is Added.

19_Application_Gateway_Azure_20

Click on Next, In the Configuration section, we will connect the frontends and backend pools

19_Application_Gateway_Azure_21

Click on Add a routing role, Now In Listener section, fill the below details ,

19_Application_Gateway_Azure_22

And in Backend Targets section, select the Backend Target and for Backend Settings, click on Add new

19_Application_Gateway_Azure_23

Fill the below details in Backend settings,

19_Application_Gateway_Azure_24

Now we have added both the Listener and Backend Targets, Click on Add.

19_Application_Gateway_Azure_25

Now the Routing rule is added.

19_Application_Gateway_Azure_26

Click on Next , Review and Create.

19_Application_Gateway_Azure_27

It will take 5 mins to get created, after that we can see the Application Gateway is created,

19_Application_Gateway_Azure_28

Check the Backend Health of the Application Gateway to ensure it is Healthy

19_Application_Gateway_Azure_29

Copy the Public IP of Application Gateway - http://52.226.176.40/

19_Application_Gateway_Azure_30

Try to open the link - http://52.226.176.40/index.html

19_Application_Gateway_Azure_31