This has been acknowledged as a bug in App Service by MS support and "will be rolled out in next release cycle (tentatively)."
Intermittant issue with app service slot autoswaps and warmup
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?
5 additional answers
Sort by: Most helpful
-
Emanuele De Cupis 1 Reputation point
Oct 20, 2020, 4:46 PM Hi all, any update on this bug? I'm experiencing the same, too.
-
JDB 21 Reputation points
Nov 23, 2020, 8:11 AM I suddenly experience it today.
Failed to complete swap between slot 'Bridge' and slot 'production'. Error: {"_body":"{\"Code\":\"BadRequest\",\"Message\":\"Cannot swap slots for site 'qompro' because the application initialization in 'Bridge' 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.\",\"Target\":null,\"Details\":[{\"Message\":\"Cannot swap slots for site 'qompro' because the application initialization in 'Bridge' 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.\"},{\"Code\":\"BadRequest\"},{\"ErrorEntity\":{\"ExtendedCode\":\"04903\",\"MessageTemplate\":\"Cannot swap slots for site '{0}' because the application initialization in '{1}' 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.\",\"Parameters\":[],\"InnerErrors\":[],\"Code\":\"BadRequest\",\"Message\":\"Cannot swap slots for site 'qompro' because the application initialization in 'Bridge' 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.\"}}],\"Innererror\":null}","status":400,"ok":false,"statusText":"OK","headers":{"cache-control":["no-cache"],"content-length":["1217"],"content-type":["application/json; charset=utf-8"],"date":["Mon"," 23 Nov 2020 07:55:23 GMT"],"expires":["-1"],"pragma":["no-cache"],"server":["Microsoft-IIS/10.0"],"strict-transport-security":["max-age=31536000; includeSubDomains"],"x-aspnet-version":["4.0.30319"],"x-ms-correlation-request-id":["fa54dc51-8ea4-4a44-a0e7-8ce6d7851695"],"x-ms-ratelimit-remaining-subscription-reads":["11952"],"x-ms-request-id":["fa54dc51-8ea4-4a44-a0e7-8ce6d7851695"],"x-ms-routing-request-id":["UAENORTH:20201123T075523Z:fa54dc51-8ea4-4a44-a0e7-8ce6d7851695"],"x-powered-by":["ASP.NET"]},"type":2,"url":"https://management.azure.com/subscriptions/80ca208d-8a79-4774-8633-6bd5d5e9febe/resourceGroups/sic/providers/Microsoft.Web/sites/qompro/slots/Bridge/operationresults/bf7a15dc-0bd1-4125-a8c6-cc29e395fca3?api-version=2018-11-01"}
-
Mark Bowler 101 Reputation points
Nov 25, 2020, 5:25 PM We get the same problem when using the WARMUP_PING_PATH, the slot swap intermittently fails with same error. In our case, repeating the slot swap normally succeeds.
-
Lloyd Mason 0 Reputation points
Oct 5, 2023, 11:51 AM This is still an issue.
WEBSITE_PLATFORM_VERSION = 100.0.x.xxx
WEBSITE_WARMUP_PATH = /health
WEBSITE_SWAP_WARMUP_PING_STATUSES = 200