Hi Live, welcome to MS Q&A
Yes, there are several potential timeout mechanisms in Azure and other layers of your setup that could affect long-running HTTP requests. Here’s a detailed approach to diagnosing and addressing the issue:
- Client-Side Timeout
Ensure that the client script running on Machine B does not have a timeout that is less than the duration your task takes. In Python's requests
library, the timeout
parameter controls
Solution:
Increase the timeout setting in the client script
import requests
response = requests.get('https://<MachineA_IP_or_DNS>:6443', timeout=3600) # timeout in seconds
- Azure Load Balancer/Network Timeouts
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.
Solution:
Increase the idle timeout for your Azure Load Balancer, check this doc for step wise solution https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-tcp-idle-timeout?tabs=tcp-reset-idle-portal
- Application Gateway Timeouts
If you're using Azure Application Gateway, The TCP idle timeout is a 4-minute default on the frontend virtual IP (VIP) of both v1 and v2 SKU of Application Gateway. You can configure the TCP idle timeout value on v1 and v2 Application Gateways to be anywhere between 4 minutes and 30 minutes.
Solution - please check this thread https://learn.microsoft.com/en-us/answers/questions/1371233/getting-gateway-timeout-in-azure-application-gatew
Please let me know if any further questions
Kindly accept answer, if it helps
Thanks
Deepanshu