« Creating custom Windows event logs and sources in a Windows Azure Compute startup task | Main | Troubleshooting a typical Windows Azure Storage Emulator database issue »

01/30/2011

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a012876b389bb970c0148c827c9c9970c

Listed below are links to weblogs that reference Poor man’s approach to application pool warm-up for IIS in a Windows Azure web role:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Chris Snyder

Nice approach, thank you for sharing. Much easier to wire-up in Azure than the IIS Application Warm-up module... bonus points for not requiring full IIS the way the module does.

Travis

Steve Marx posted a solution to edit the app pool timeout when the role starts:
http://blog.smarx.com/posts/controlling-application-pool-idle-timeouts-in-windows-azure

Thomento

To make it work with HTTPS endpoints (HttpsIn), I had to change ServicePointManager.ServerCertificateValidationCallback (sorry for the formatting).


public void WarmUp(string endpointName)
{
RemoteCertificateValidationCallback allowAllCertificatesCallback = (sender, certificate, chain, sslPolicyErrors) => true;
ServicePointManager.ServerCertificateValidationCallback += allowAllCertificatesCallback;
try
{
RoleInstanceEndpoint endpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints[endpointName];

string address = String.Format("{0}://{1}:{2}", endpoint.Protocol, endpoint.IPEndpoint.Address, endpoint.IPEndpoint.Port);

var webClient = new WebClient();
webClient.DownloadString(address);
}
catch (Exception)
{
// intentionally swallow all exceptions here.
}
ServicePointManager.ServerCertificateValidationCallback -= allowAllCertificatesCallback;
}

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.

Shared items (Google Reader)