How to add a load balancer on an azure container app

lalin 0 Reputation points
2023-12-12T07:58:08.7266667+00:00

I'm trying to add a load balancer to a container app. So far, I've come across this documentation that adds an application gateway to a container app, and I followed it. I created a page on my container app that shows the current IP address, and I added some scaling rules as well. When I tried to load test my container app, it only showed a single IP repeatedly. However, I was expecting it to switch to the other replicas' IP addresses, which were created due to scaling, and perform load balancing. Hence, I would like to clarify whether a container app that's in an internal environment would automatically have a load balancer? (based on this documentation) If not, then how would I be able to add one?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
972 questions
Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
410 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
290 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cary Chai 10 Reputation points Microsoft Employee
    2023-12-14T23:53:09.1966667+00:00

    Hi lalin, every Azure Container Apps environment has a load balancer which then directs traffic to the appropriate apps and replicas within the environment. The load balancer for this is exposed as a single IP. Regardless of which replica is processing your requests, this IP will remain constant and will be the entry point for your traffic into the environment. To verify that your traffic is in fact being load balanced, you can check your logs to see if multiple replicas are receiving the requests.

    2 people found this answer helpful.