mslot
mslot

Reputation: 5224

Azure webapi warmup

When reading the docs: https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#swap-operation-steps, step 4, this is specified:

If auto swap is enabled with custom warm-up, trigger Application Initiation by making an HTTP request to the application root ("/") on each instance of the source slot.

If applicationInitialization isn't specified, trigger an HTTP request to the application root of the source slot on each instance.

If an instance returns any HTTP response, it's considered to be warmed up.

Does it mean that 1) custom warm-up has to be enabled for the swap to call root (or any other urls), or 2) if custom warm-up isn't enable it calls root? Regardless of 1) or 2): if nothing is specified, all status codes returned tells the swap process that the slot is warmed up?

UPDATE The way I read the docs (https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#swap-operation-steps):

... App Service does the following to ensure that the target slot doesn't experience downtime:

1. ...
2. ...
3. ...
4. If auto swap is enabled with custom warm-up, **[AppService will]** trigger Application Initiation by making an HTTP request to the application root ("/") on each instance of the source slot.

If applicationInitialization isn't specified, **[AppService will]** trigger an HTTP request to the application root of the source slot on each instance.

If an instance returns any HTTP response, it's considered to be warmed up.
5. ...

But it seems like I am reading it wrong?

Upvotes: 0

Views: 3555

Answers (1)

Sunny Sharma
Sunny Sharma

Reputation: 4934

Let me answer your questions one by one:

1: custom warm-up has to be enabled for the swap to call root (or any other urls)

Yes, if auto-swap is enabled and you want the staging slot to warm up before the swap process starts. Otherwise, it will warm up on the first request and delay the response until the warm up is complete.


2: or, if custom warm-up isn't enabled it calls root?

It will not call root by itse lf it not specified under system.webServer > ApplicationInitialization in web.config file.


3: Regardless of 1 or 2: if nothing is specified, all status codes returned tells the swap process that the slot is warmed up?

It will just swap the slots if nothing is specified, without considering the warm-up at all. Only when the applicationInitialization block is available in web.config file then it will wait for ApplicationInitialization module to return a completion status, and then proceed with the swap.


Even after the warm-up is done at staging slot, while swapping the staging-slot-worker-process may still restart, given the configuration differences in the startup.

I've observed the swap process incurring zero downtime when the staging and production configuration is exactly matching.

There are several other cases about the application warm-up and restart during the swap process, please refer to this article: https://ruslany.net/2017/11/most-common-deployment-slot-swap-failures-and-how-to-fix-them/

Upvotes: 3

Related Questions