Intermittant issue with app service slot autoswaps and warmup

Alastair 131 Reputation points
2020-08-12T10:31:09.17+00:00

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?

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

Accepted answer
  1. Alastair 131 Reputation points
    2020-08-25T16:20:41.577+00:00

    This has been acknowledged as a bug in App Service by MS support and "will be rolled out in next release cycle (tentatively)."

    1 person found this answer helpful.

5 additional answers

Sort by: Most helpful
  1. Emanuele De Cupis 1 Reputation point
    2020-10-20T16:46:07.323+00:00

    Hi all, any update on this bug? I'm experiencing the same, too.

    0 comments No comments

  2. JDB 21 Reputation points
    2020-11-23T08:11:34.003+00:00

    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"}
    
    0 comments No comments

  3. Mark Bowler 101 Reputation points
    2020-11-25T17:25:57.95+00:00

    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.

    0 comments No comments

  4. Lloyd Mason 0 Reputation points
    2023-10-05T11:51:06.1933333+00:00

    This is still an issue.

    WEBSITE_PLATFORM_VERSION = 100.0.x.xxx
    WEBSITE_WARMUP_PATH = /health
    WEBSITE_SWAP_WARMUP_PING_STATUSES = 200

    0 comments No comments