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?