Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
The swap only waits on the warm-up request, and by default any HTTP response code counts as a valid warm-up. An instance that answers with an error can therefore be treated as ready. To tighten this on Linux, use the swap warm-up app settings, since applicationInitialization is a Web.config element.
- On the slot you swap from, add WEBSITE_SWAP_WARMUP_PING_PATH with a path that only succeeds once your app is truly ready, for example /statuscheck.
- Add WEBSITE_SWAP_WARMUP_PING_STATUSES with 200,202 so any other code stops the warm-up and the swap.
- Optionally add WEBSITE_WARMUP_PATH so the same path is also pinged on every restart, not only on swaps.
If errors continue, tell me which path your app serves for health and what the failing requests return.
References:
If this solved it, please click Accept Answer and upvote so others with the same problem can find it.