Containerized ASP.NET app on Azure App Service F1 warmup times out on first run

Jan Hein de Jong 0 Reputation points
2024-02-28T10:14:29.36+00:00

After having done mostly on-prem stuff at my company, we decided we want to give Azure a try. I'm trying to run a containerized ASP.NET app (with react frontend served as static files), on a free-tier (F1) app service.

When I haven't called the app in a while - as expected - the service goes to sleep and kills the container. When a client tries to connect with my app, the service tries to relaunch the container, by pulling the container, starting it (and some adjacent MSI container), and starts checking readiness by sending warmup requests. So far, so good.

Now the weird stuff starts.

These warmup requests time-out after 230 s, but if I inspect the container logs, I see the app is already up and listening. After the warmup timeout, the app service kills the container, and repeats the process of pulling, starting, and sending warmup requests, which now goes through almost instantly (and my app works fine).

Any ideas what could cause this behavior? A quick fix would be to set this warmup timeout to something like 2-3 seconds, but it feels weird.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.