Module 7: Assignment - 2
Tasks To Be Performed: Create an application gateway with the following configuration:
a.
/vm1 should point to VM1b.
/vm2 should point to VM2
Using VMs from Assignment 1: Module 7
I need to create the ‘VM1’ and ‘VM2’ directories on the servers.
Step 2: Create an Application Gateway
-
I Create an Application Gateway:
- I search “Application Gateway” and click ”+ Create”.
- I start the creation process and fill in the basic information such as name, region, and the VNet where my VMs are located.
- Under “Tier”, I can select “Standard”.
- Will need to create a subnet just for the gateway
Click “Manage subnet configuration” and ”+ Subnet”
-
Frontends I’ll reuse the same Public IP address as Assignment 1: Module 7
Step 3: Configure Backend Pools
- I Add Backend Pools:
- In the Application Gateway creation wizard, I add two backend pools:
-
One for VM1: I name it
vm1Pool
and add VM1 to this pool. -
One for VM2: I name it
vm2Pool
and add VM2 to this pool. -
This is wrong the listener is attached to the pool, so the pool has to have both VMs
-
-
- In the Application Gateway creation wizard, I add two backend pools:
Step 4: Configure Settings
-
I Set Up Listeners:
- In “Routing rules” I click ”+ Add a routing rule”.
- I create a basic listener for incoming traffic. If HTTPS is required, certificates will need to be configured here.
-
I Configure Routing Rules:
- I add path-based routing rules:
- For
/vm1
, I create a rule that routes traffic tovm1Pool
. added new “Backend settings” left everything default
after clicking “Add multiple targets to create a path-base rule” - For
/vm2
, I create a rule that routes traffic tovm2Pool
.
- For
- I add path-based routing rules:
Step 5: Review and Create
-
I Review All Settings:
- I ensure all configurations are correct, including backend pools, listeners, and routing rules.
-
I Create the Application Gateway:
- I finalize the setup and create the Application Gateway.
Step 6: Test the Application Gateway
-
I Find the Public IP of the Application Gateway:
- Once the Application Gateway is deployed, I note its public IP address or DNS name.
-
I Test the URL Path-Based Routing:
- In a web browser, I test the URL paths:
http://<AppGateway-IP-or-DNS>/vm1
should route to VM1.http://<AppGateway-IP-or-DNS>/vm2
should route to VM2.
- In a web browser, I test the URL paths:
By completing these steps, you have successfully created an Azure Application Gateway that routes traffic based on URL paths to different VMs, according to your assignment’s requirements.
1 rule has 1 listener, once listener port 80, is taken can be used in another rule, so 1 rule needs to access both vm, which means both VM need to go into one Backend Pool, cuse 1 listener 1 pool
Click on add multiple
Issue:
caused by Backend Setting
So the issue is when the gateway recived a request to acccess the page, it gets header with gateway IP, and that IP is passed to the VMs but the VMs do not have that IP so they dont recognize it. Need to put override so gateway translate to what the vm is expexting
Need three pools
1 fort vm1 “VM1_path”
2 for vm2 “VM2_path”
3 for both “VM_Pool”
Initially I had 1 pool ”VM_pool’ with both and that was put in
This cause, when i access IP/vm1 to work then when i refresh it will look for the other server and fail, refresh work, resfresh look for the other server fail, cuse the other servers doesnt have path
For notes