Header logo.
small hallucinations
homeyearstagsaboutrss

When an Azure Health Probe Turns File Uploads into 503s

I was recently working with a container app deployed on Azure. The app provides a REST endpoint that allows users to upload files for processing.

A few days ago, uploads of larger files started failing repeatedly, even though the files weren't particularly large. One that consistently failed to upload was only 4 MB.

I tried uploading the file both with curl and through the web UI. Both attempts failed with HTTP status 503. That ruled out a CORS issue, which would have produced a different status code and would not have caused the curl request to fail.

Interestingly, we couldn't find these POST requests in the logs, suggesting that they never reached the container app.

While inspecting the configuration of this app and others deployed on Azure, I noticed that this one had a health-probe setting.

It turned out that Azure was checking whether the service was alive every ten seconds. Because the app became temporarily unresponsive during uploads and processing, the health probe likely timed out.

Azure would have interpreted this as a sign that the container was down and either removed it from the load balancer or tried to restart it. Either way, the request was abruptly terminated, resulting in a 503 error.