Comments on: How to warm up Azure Web App during deployment slots swap https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/ Azure App Service Features and Best Practices Mon, 17 Apr 2023 02:44:52 +0000 hourly 1 https://wordpress.org/?v=6.2.16 By: How Do I Use ApplicationInitialization To Control The Endpoint For Azure's Always On Feature? - Programming Questions And Solutions Blog https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-46890 Mon, 17 Apr 2023 02:44:52 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-46890 […] You can read more about this feature here: http://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/ […]

]]>
By: Phil https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-21118 Wed, 10 Mar 2021 16:49:11 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-21118 Hi Ruslan,

Does either the App initialisation or WEBSITE_SWAP_WARMUP_PING_PATH work with Azure functions? We’re finding that when we swap slots on our functions app, were getting a brief 503 unavailable and I haven’t been able to get either of App Initialisation or WEBSITE_SWAP_WARMUP_PING_PATH working for Azure functions.

]]>
By: Jeff Yaskus https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-16371 Thu, 24 Sep 2020 16:40:44 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-16371 In reply to Midhun Jose.

The swap operation is essentially a DNS swap between “primary” and “deployment” slots … the file systems are 100% independent of each other and after your deployment slot is “swapped”.

For simple example, I create a deployment slot and its filesystem … deploy my updated code to that slot … later, swap the staging slot with primary webapp … afterwards, my updated code is now on the primary slot … and my previous software version is now under the “staging” deployment slot.

Also, for the questions about restarts as part of the swap operation … in my experience, it restarts the endpoints while swapping … only in cases were the “WebApp configuration settings” themselves change.
Otherwise, the swap operation can (in theory) be done with NO impact on traffic … as existing traffic to either the deployment slot and/or primary instance is allowed to complete … then redirected by utilizing DNS to the “new” destination.

]]>
By: Midhun Jose https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12630 Tue, 26 May 2020 12:29:16 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12630 Great article.

Also one doubt regarding the swap operation
while we are swapping from stage to prod
how about the files in the root folder will they also be swapped like the App_data folder under the wwwroot of both the webapp slots staging and prod.
Thanks,
Midhun

]]>
By: Sebastian https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12455 Tue, 19 May 2020 03:25:15 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12455 Hello,
we currently encounter the problem that only three of our four instances get the call for the swap-endpoint we defined and then the swap just fails. I checked the http-logs in Kudu and can see that three of the instances get the “GET /swap” from “SiteWarmup” while the fourth instance just has “GET /” from AlwaysOn and HostnameSyncPinger during that time. So that instance is up and serving requests, but didn’t get any for the Swap-Endpoint.
Any idea how we could solve this or who to talk to to get this solved?
Thx
Sebastian

]]>
By: Ruslan https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12445 Mon, 18 May 2020 17:04:15 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12445 In reply to Eric.

Hi Eric,

For the cases when first request takes many seconds – do you see the prior warmup requests before that? Or the URLs are never warmed up? Also when you talk about many seconds – how many is it – tens or hundreds?

]]>
By: Eric https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12268 Wed, 13 May 2020 08:54:32 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-12268 Hi Ruslan!

We got an .NET Core 3.1 API running on two P2V2 instances. We have the application warmup in place as you described. By writing to the logging we can see the warmup being initialized. We warmup the following:
– Identity Sever 4 (generating tokens)
– Azure Key Vault (load encryption keys)
– Redis and Memory Cache (pre-load caches)
– Entity Framework Core (making a few queries)

However when we are under heavy peak/burst load and we are scaling out, there are still a few requests taking more then 30 seconds making the app unstable and queues filling up.

I thoroughly tested the effects of warmup by logging request/execution times and I see that the first request takes many seconds and the subsequent test-calls are finished ms.

So this makes me doubt the Azure infrastructure (PaaS) limiting something here?

]]>
By: Ruslan https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-8261 Tue, 03 Dec 2019 23:54:42 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-8261 In reply to Evan.

Hi Evan, the timeout for the warmup path is 90 seconds. It is retried 5 times and if all 5 times the requests time out then the swap fails. If it takes so long time for an application to start up then maybe swap with preview would be a better option? That way you will initiate the first step of the swap which will apply production settings on the site in the staging slot and will restart the site. Then you can make http requests to all the warm up paths on that site. After you’ve made sure it is up and running then you complete the swap. The warmed-up site will be moved to production slot without restarting again.

]]>
By: Evan https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-8259 Tue, 03 Dec 2019 23:00:29 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-8259 Ruslan

Our site takes some time to load and setting the warmup path and the status code fails my swap. I believe the startup watcher times out before we’re up and running and able to provide a 200. Does the warm up path get hit repeatedly until until the required status code is returned or will it try to access the path one time and then fail if 200 isn’t provided? If it only tries to execute the warm up path once, is there a way to specify multiple warm up attempts before failing?

]]>
By: Ruslan https://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-8199 Mon, 02 Dec 2019 17:52:19 +0000 https://ruslanynet.azurewebsites.net/2015/09/30/how-to-warm-up-azure-web-app-during-deployment-slots-swap/#comment-8199 In reply to DM.

It maybe that the sitecore page that is hit during warmup does not involve executing the server side code? Maybe it just responds with http 301 or 304 status code? You can also try to specify the specific warm up URL and expected status code as described in Azure App Service Deployment Slots Tips and Tricks.

]]>