An Azure service that provides a cloud content delivery network with threat protection.
Hello @Jeff Olmstead
If the slow response time is expected (for example, a report generation endpoint), you can increase the timeout in Front Door.
For Azure Front Door Standard/Premium:
# Update the origin response timeout for a Front Door profile
# Maximum allowed value is 240 seconds
az afd profile update \
--resource-group myResourceGroup \
--profile-name myFrontDoor \
--origin-response-timeout-seconds 120
For classic Azure Front Door, the timeout is set at the profile level:
# Update the backend timeout for classic Front Door
az network front-door update \
--resource-group myResourceGroup \
--name myFrontDoor \
--send-recv-timeout 120
Please ensure that increasing the timeout means clients wait longer for a response. For user-facing endpoints, anything over 30 seconds is a poor experience. Consider using asynchronous patterns (return a 202 Accepted and poll for results) for long-running operations.
Also,
- Check backend performance Bypass Front Door and hit the backend directly (use the backend URL or IP). If it’s slow or hangs, AFD will time out and return 504. Look at logs from your app, database, or any downstream APIs to see if requests are taking longer than 30 seconds.
- Check backend health in AFD In the Azure portal, go to your Front Door profile → Backend pools → see if the backend shows as Unhealthy or intermittent health. If health probes fail, AFD may stop routing traffic or fall back to a slower path, which can also cause 504s.
- Review AFD timeout settings The default origin response timeout is 30 seconds. If your backend realistically needs more time (for example 60–120 seconds), you can increase the Origin response timeout in the Front Door profile (Standard/Premium SKUs) up to 240 seconds. This reduces 504s without changing your app code.
- Check network and security Make sure NSG rules, firewalls, WAF, or load balancers are not blocking or delaying traffic from AFD’s POPs. If AFD is routed through a private link or VNet, ensure the Private Endpoint is approved and connected.
- Use logs and ErrorInfo Look at AFD’s diagnostics / Front Door Analytics logs and filter for
504responses plus theErrorInfofield. If it showsOriginTimeout, you know the backend simply took too long and you either need to optimize the backend or increase the timeout.
Reference:
- Troubleshoot common issues - Azure Front Door | Microsoft Learn
- Configure Azure Front Door Logs | Microsoft Learn
Kindly let us know if the above helps or you need further assistance on this issue.
Please “up-vote” wherever the information provided helps you, this can be beneficial to other community members.