Home

Problem with custom warmup in app service

%3CLINGO-SUB%20id%3D%22lingo-sub-1197408%22%20slang%3D%22en-US%22%3EProblem%20with%20custom%20warmup%20in%20app%20service%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1197408%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20add%20a%20custom%20page%20for%20warmup%20so%20that%20after%20swapping%20slots%20in%20azure%20dev%20ops%20release%20pipeline%2C%20the%20application%20from%20the%20secondary%20slot%20will%20be%20warmed%20up.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWeb.config%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E...%3CBR%20%2F%3E%3CAPPLICATIONINITIALIZATION%3E%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%3CADD%20initializationpage%3D%22%26quot%3B%2FWarmup.aspx%26quot%3B%22%3E%3CBR%20%2F%3E%3C%2FADD%3E%3CBR%20%2F%3E...%3C%2FAPPLICATIONINITIALIZATION%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Easpx%20page%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Epublic%20partial%20class%20Warmup%20%3A%20System.Web.UI.Page%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20protected%20void%20Page_Init(object%20sender%2C%20EventArgs%20e)%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%7B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Thread.Sleep(600000)%3B%20%2F%2F%2010%20minutes%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20test%2C%20I%20added%20Thread.Sleep%20without%20real%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20swap%20takes%20about%203%20minutes%2C%20although%20at%20least%20a%20warm-up%20should%20take%2010%20minutes.%20As%20a%20result%2C%20I%20get%20a%20cold%20application.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20am%20I%20doing%20wrong%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1197408%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApp%20Services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

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?