Configuring load balancing rules

You can also configure load balancing rules from the Azure portal. In the following demo, we are going to create a new routing rule that routes all the traffic that is coming in on port 81 to PacktVM2. First, we need to create a new backend pool; then, we can add a listener that picks up the traffic and calls the rule to route the traffic to the right backend server. To configure this, take the following steps:

  1. Navigate to the Azure portal by opening https://portal.azure.com/.
  2. Open the application gateway resource that we created in the previous section.
  3. First, we need to create a backend pool. This will be associated with the new rule in the upcoming steps. 
  4. Under Settings, select Backend pools and click Add in the top menu, as shown in the following screenshot:

Creating a backend pool
  1. Add the following values, as shown in the following screenshot:
    • Name: Packt2BackendPool
    • Add backend pool without targets: No
    • Target type: Select Virtual machineTargetPacktNic2
  2. Click Add:

Backend pool settings
  1. Next, create the listener. Under Settings, select Listeners and click Basic in the top menu, as shown in the following screenshot:

Creating a listener
  1. Fill in the following values, as shown in the following screenshot:
    • Listener name: Packt2AGListener
    • Frontend IP: Public
    • Port81
    • Protocol: HTTP
  1. Click OK:

Listener settings
  1. Now, under Settings, select Rules and, in the top menu, select Basic to create a new rule, as shown in the following screenshot:

Creating a new rule
  1. Add the following settings:
    • Name: Rule2
    • Listener: Packt2AGListener
    • Backend pool:  Packt2BackendPool
    • HTTP settings: PacktPoolSettings 
  2. Click OK:

Rule settings
  1. You can test the rule by navigating to the following URL in the browser: http://<public-ip-address>:81You will be redirected to PacktVM2.

Next, we will look at how to manage application load balancing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset