SOLVED

Problem with custom warmup in app service

Copper Contributor

I'm trying to add a custom page for warmup so that after swapping slots in azure dev ops release pipeline, the application from the secondary slot will be warmed up.

 

Web.config:

 

...
<applicationInitialization>
    <add initializationPage="/Warmup.aspx">
</applicationInitialization>
...

 

aspx page:

 

public partial class Warmup : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        Thread.Sleep(600000); // 10 minutes
    }
}

 

For test, I added Thread.Sleep without real code.

 

A swap takes about 3 minutes, although at least a warm-up should take 10 minutes. As a result, I get a cold application.

 

What am I doing wrong?

1 Reply
best response confirmed by motasem13 (Microsoft)
Microsoft Verified Best Answer
Solution

@user6868 I'm guessing that the request is timing out

 

During the swap operation the site in the staging slot is warmed up by making an HTTP request to its root directory.

By default the swap will proceed as long as the site responds with any status code.

Utilizing this, could help to avoid cold starts, undesired downtimes or high latency situations.

 

However, if you prefer the swap to not proceed if the application fails to warm up then you can configure it by using these app settings:

 

  • WEBSITE_SWAP_WARMUP_PING_PATH - The path to make the warm up request to (default value - “/”)
  • WEBSITE_SWAP_WARMUP_PING_STATUSES - Expected HTTP response codes for the warm-up operation
1 best response

Accepted Solutions
best response confirmed by motasem13 (Microsoft)
Microsoft Verified Best Answer
Solution

@user6868 I'm guessing that the request is timing out

 

During the swap operation the site in the staging slot is warmed up by making an HTTP request to its root directory.

By default the swap will proceed as long as the site responds with any status code.

Utilizing this, could help to avoid cold starts, undesired downtimes or high latency situations.

 

However, if you prefer the swap to not proceed if the application fails to warm up then you can configure it by using these app settings:

 

  • WEBSITE_SWAP_WARMUP_PING_PATH - The path to make the warm up request to (default value - “/”)
  • WEBSITE_SWAP_WARMUP_PING_STATUSES - Expected HTTP response codes for the warm-up operation

View solution in original post