Hello, @Shuchita Chiwande !
Why am I receiving an error after 5 or more minutes of no requests sent when using a load balancer?
Given that this works for the first couple minutes, it sounds like you are running into an idle timeout on your load balancer (default is 4 minutes):
Azure Load Balancer rules have a default timeout range of 4 minutes to 100 minutes for Load Balancer rules, Outbound Rules, and Inbound NAT rules. The default setting is 4 minutes. If a period of inactivity is longer than the timeout value, there's no guarantee that the TCP or HTTP session is maintained between the client and your service.
You can set the idle timeout and tcp reset for a load balancer by editing the load-balanced rule in the Azure portal:
- Sign in to the Azure portal.
- In the left-hand menu, select Resource groups.
- Select the resource group for your load balancer. In this example, the resource group is named myResourceGroup.
- Select your load balancer. In this example, the load balancer is named myLoadBalancer.
- In Settings, select Load balancing rules.
- Select your load-balancing rule. In this example, the load-balancing rule is named myLBrule.
- In the load-balancing rule, input your timeout value into Idle timeout (minutes).
- Under TCP reset, select Enabled.
- Select Save.
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!