Azure Application Gateway is a web traffic load balancer that enables manage traffic to web applications using.Application Gateway is a layer 7 load balancer, which means it works with web traffic only (HTTP/HTTPS/WebSocket)
In Azure portal click new-Application gateway
For application gateway dedicated subnet is created (10.0.3.0/24)
Create availability set
and create public address
Creating Backend Pool
Backend pools can be composed of NICs, virtual machine scale sets, public IPs, internal IPs, fully qualified domain names (FQDN), and multi-tenant back-ends like Azure Web Apps. Application Gateway backend pool members are not tied to an availability set.
In resource group click on Application gateway-Backend Pools.Default pool is created-click on it
On target drop-down list select Virtual machine
Select Virtual machines (in this case there are 2 VM’s:app1 and app2
Health probes
Azure Application Gateway by default monitors the health of all resources in its back-end pool and automatically removes any resource considered unhealthy from the pool. Application Gateway continues to monitor the unhealthy instances and adds them back to the healthy back-end pool once they become available and respond to health probes.
Click on Health probes (default one is created alongside with Application gateway)
For host type 127.0.0.1, for path type /index.txt
On app1 and app2 servers,IIS is installed and under c:\intetpub\wwwroot folder index.txt file is created.It will be used as “probe” to check backed server availability (HTTP response 200)
Content of index.txt
This is server 1-on app1 machine
This is server 2-on app2 machine
Interval:Configures the probe interval checks in seconds.
Timeout:Defines the probe time-out for an HTTP response check.
UnhealthyThreshold:The number of failed HTTP responses needed to flag the back-end instance as unhealthy.
HTTP settings
Click on default HTTP settings
Select health probe and port
When a user request is received, Application Gateway applies the configured rules to the request and routes it to a back-end pool instance. It waits for a configurable interval of time for a response from the back-end instance. By default, this interval is 30 seconds. If Application Gateway does not receive a response from back-end application in this interval, user request would see a 502 error.
In Application Gateway settings,in Overview properties we can see public IP