Create an Internal load balancer in the Azure portal

Important

Azure Load Balancer supports two different types: Basic and Standard. This article discusses Basic Load Balancer. Although Basic Load Balancer is generally available, Standard Load Balancer is currently in public preview. For more information about Standard Load Balancer, see Standard Load Balancer overview.

Azure Internal Load Balancer (ILB) provides network load balancing between virtual machines that reside inside a cloud service or a virtual network with a regional scope.

For information about the use and configuration of virtual networks with a regional scope, see Regional virtual networks. Existing virtual networks that have been configured for an affinity group cannot use ILB.

Configuration scenario

In this scenario, we're creating an internal load balancer in a virtual network as shown in the following figure:

Internal load balancer scenario

The configuration for our scenario is as follows:

  • Two virtual machines named DB1 and DB2
  • Endpoints for the internal load balancer
  • An internal load balancer

Get started creating an Internal load balancer using Azure portal

Use the following steps to create an internal load balancer from the Azure portal.

  1. Open a browser, navigate to the Azure portal, and sign in with your Azure account.
  2. In the upper left hand side of the screen, click New > Networking > Load balancer.
  3. In the Create load balancer blade, enter a Name for your load balancer.
  4. Under Scheme, click Internal.
  5. Click Virtual network, and then select the virtual network where you want to create the load balancer.

    Note

    If you do not see the virtual network you want to use, check the Location you are using for the load balancer, and change it accordingly.

  6. Click Subnet, and then select the subnet where you want to create the load balancer.

  7. Under IP address assignment, click either Dynamic or Static, depending on whether you want the IP address for the load balancer to be fixed (static) or not.

    Note

    If you select to use a static IP address, you have to provide an address for the load balancer.

  8. Under Resource group either specify the name of a new resource group for the load balancer, or click select existing and select an existing resource group.

  9. Click Create.

Configure load balancing rules

After the load balancer creation, navigate to the load balancer resource to configure it. Configure a backend address pool and a probe before configuring a load balancing rule.

Step 1: Configure a backend pool

  1. In the Azure portal, click Browse > Load balancers, and then click the load balancer that you created earlier.
  2. In the Settings blade, click Backend pools.
  3. In the Backend address pools blade, click Add.
  4. In the Add backend pool blade, enter a Name for the backend pool, and then click OK.

Step 2: Configure a probe

  1. In the Azure portal, click Browse > Load balancers, and then click the load balancer that you created earlier.
  2. In the Settings blade, click Probes.
  3. In the Probes blade, click Add.
  4. In the Add probe blade, enter a Name for the probe.
  5. Under Protocol, select HTTP (for web sites) or TCP (for other TCP-based applications).
  6. Under Port, specify the port to use when accessing the probe.
  7. Under Path (for HTTP probes only), specify the path to use as a probe.
  8. Under Interval specify how frequently to probe the application.
  9. Under Unhealthy threshold, specify how many attempts should fail before the backend virtual machine is marked as unhealthy.
  10. Click OK to create probe.

Step 3: Configure load balancing rules

  1. In the Azure portal, click Browse > Load balancers, and then click the load balancer that you created earlier.
  2. In the Settings blade, click Load balancing rules.
  3. In the Load balancing rules blade, click Add.
  4. In the Add load balancing rule blade, enter a Name for the rule.
  5. Under Protocol, select HTTP (for web sites) or TCP (for other TCP-based applications).
  6. Under Port, specify the port clients connect to in the load balancer.
  7. Under Backend port, specify the port to be used in the backend pool (usually, the load balancer port and the backend port are the same).
  8. Under Backend pool, select the backend pool you created earlier.
  9. Under Session persistence, select how you want sessions to persist.
  10. Under Idle timeout (minutes), specify the idle timeout.
  11. Under Floating IP (direct server return), click Disabled or Enabled.
  12. Click OK.

Next steps

Configure a load balancer distribution mode

Configure idle TCP timeout settings for your load balancer