I am experiencing an intermittent issue with app service deployment slots and warm-ups.
Every day we create a new app service plan, app service, and a deployment slot in North Europe region. The slot is configured with the auto swap feature enabled. Although we have not changed our code, a couple of weeks ago we started experiencing an intermittent issue suggesting something may have changed within app service as it was working reliably beforehand.
We create the infrastructure and then deploy to the slot using zip deploy. Autoswap starts and we poll the status API. Occasionally like today we are given an app service plan where all app services will fail to slot swap because the swap warmup always fails no matter what we do. The slot is configured with app settings WEBSITE_SWAP_WARMUP_PING_PATH = "/api/healthcheck" and WEBSITE_SWAP_WARMUP_PING_STATUSES="200" and even though that API is returning a 200 code the warm up always fails for all app services on that plan.
The error is
"Failed swapping site. Error: Cannot swap slots for site XXX because the application initialization in 'XXX' slot either took too long or failed. Please check AppInit module configuration or try using swap with preview if application initialization time is very long. "
However, we are certain the warm up returned a 200 status and no sites on that plan will succeed for a slot swap if WEBSITE_SWAP_WARMUP_PING_PATH is configured. If you remove the WEBSITE_SWAP_WARMUP_PING_PATH setting then the slot swap will succeed, (but the app does not get warmed up!)
The only workaround is to destroy the app service plan and recreate everything, whereby usually the deploy and slot swap with warmup will start working again.
Is it possible there is a bug in app service?