Integrate Azure Spring Apps with Azure Load Balance Solutions

Note

The Basic and Standard plans entered a retirement period on March 17, 2025. For more information, see the Azure Spring Apps retirement announcement.

Azure Spring Apps supports Spring applications on Azure. Increasing business can require multiple data centers with management of multiple instances of Azure Spring Apps.

Azure already provides different load-balance solutions. There are three common options to integrate Azure Spring Apps with Azure load-balance solutions:

  1. Integrate Azure Spring Apps with Azure Traffic Manager
  2. Integrate Azure Spring Apps with Azure App Gateway

In the examples below, we will load balance requests for a custom domain of www.contoso.com towards two deployments of Azure Spring Apps in two different regions: chinaeast2.microservices.azure.cn and chinanorth2.microservices.azure.cn.

We recommend that the domain name, as seen by the browser, is the same as the host name which the load balancer uses to direct traffic to the Azure Spring Apps back end. This recommendation provides the best experience when using a load balancer to expose applications hosted in Azure Spring Apps. If the domain exposed by the load balancer is different from the domain accepted by Azure Spring Apps, cookies and generated redirect URLs (for example) can be broken. For more information, see Host name preservation.

Prerequisites

Integrate Azure Spring Apps with Azure Traffic Manager

To integrate Azure Spring Apps with Traffic Manager, add its public endpoints as traffic manager's endpoints and then configure custom domain for both traffic manager and Azure Spring Apps.

Add Endpoint in Traffic Manager

Add endpoints in traffic manager:

  1. Specify Type to be External endpoint.

  2. Input fully qualified domain name (FQDN) of each Azure Spring Apps public endpoint.

  3. Select OK.

    Screenshot of the Azure portal that shows the Add endpoint page.

    Screenshot of the Azure portal that shows the Add endpoint page.

Configure Custom Domain

To finish the configuration:

  1. Sign in to the website of your domain provider, and create a CNAME record mapping from your custom domain to traffic manager's Azure default domain name.

Integrate Azure Spring Apps with Azure App Gateway

To integrate with Azure Spring Apps service, complete the following configurations:

Configure Backend Pool

  1. Specify Target type as IP address or FQDN.

  2. Enter your Azure Spring Apps public endpoints.

    Screenshot of the Azure portal that shows the Add backend pool page with the Backend targets values highlighted.

Add Custom Probe

  1. Select Health Probes then Add to open custom Probe dialog.

  2. The key point is to select No for Pick host name from backend HTTP settings option and explicitly specify the host name. For more information, see Application Gateway configuration for host name preservation.

    Screenshot of the Azure portal that shows the probe page.

Configure Backend Setting

  1. Select Backend settings then Add to add a backend setting.

  2. Override with new host name: select No.

  3. Use custom probe: select Yes and pick the custom probe created above.

    Screenshot of the Azure portal that shows the Add Backend setting page.

Next steps