Using Application Insights to keep a site online
By default, web apps are unloaded if they are idle for a while. This lets the system conserve resources. If you have access to the IIS configuration, you can configure the idle time-out
settings to 0
(details). If you are hosting your web app on Azure, you can enable the Always on
option (details).
But, if you cannot remove the idle time-out, here's a nice tip to keep your website online. The idea is to make a request at regular intervals (more frequently than the idle timeout), so the site is never unloaded.
This is where Application Insights takes action. Indeed, one of the functionalities of Application Insights is to test the availability of a website. Great news, this is free and you'll get a nice report of the up-time of your website!
Create a free Azure account
Create a new Application Insights instance
Add an availability test
Application Insights will query your website from 5 different locations every 5 minutes. This should be enough to prevent the web site from being unloaded 😃 As a bonus, you'll get nice availability and performance reports.
Do you have a question or a suggestion about this post? Contact me!