We have a web API server that sits behind Azure WAF and Traffic manager and everything is working fine except when the API returns 503 for maintenance and here are the steps to reproduce the issue.
- API starts to return 503 starting at 10:00 pm with Retry-After: 10:10 pm
- From 10:00 pm to 10:02 pm, the requests hit the server and the server returns 503 correctly.
- From 10:03 pm to 10:10 pm, Microsoft-Azure-Application-Gateway/v2 returns 502 and the requests don't even hit the server
- From 10:10 pm the requests can hit the server again.
We do not want Azure Gateway to return 502 during the maintenance window. How can I make it so that the Gateway does not return 502?