0

Azure website in the free tarif has a disadvantage that the first request is very slow because after view minutes Microsoft unload the application.

The problem is described on this site:

http://wp.sjkp.dk/windows-azure-websites-and-cloud-services-slow-on-first-request/

So I used the following code to wake up my website with a recurring webjob:

        String url = "http://myexample.azurewebsites.net";
        int i = 0;
        while (i < 20)
        { 
        var webRequest = (HttpWebRequest)WebRequest.Create(url);

            try
            {
                using (WebResponse webResponse = webRequest.GetResponse())
                { }
            }
            catch { }
            i = i + 1;
        System.Threading.Thread.Sleep(180000);
        } 

I upload the job with an recurrence of 1 hour. If I run the job local it works perfect. But as an azure job I get the following error in the process log:

Http Action - Response from host 'jobexample.scm.azurewebsites.net': 'Accepted' Response Headers: Pragma: no-cache x-ms-request-id: 123-456-abc Cache-Control: no-cache

The job status is "completed". But from start time to end time is just 3 sec. Any idea how I can solve this problem?

  • That's the error you get? – Mark C. Aug 16 '16 at 18:05
  • Just to make sure, the Always on feature is not working for your scenario? https://blogs.msdn.microsoft.com/mschray/2015/03/31/webjob-not-running-consistently-make-sure-always-on-is-on/ – Thiago Custodio Aug 17 '16 at 21:11
  • Unfortunately the "alway on" function is not available in Azure Website Free mode. So I need the standard mode which one costs to much for my project. – Benjamin Benjamin Aug 19 '16 at 04:26

0 Answers0