To prevent AppPool recycling every 20 minutes, I\'d like to remove IIS AppPool Idle Timeouts when my Azure Web Role starts. My website is a Web Application Project.
Another option is to configure IIS Idle Time-Out Action to 'Suspend'. You can do it as a part of your web role startup script.
Command that you need is on the box as part of IIS setup (note that this will work with Windows Server 2012 R2 and up, with your code targeting .NET 4.5.1 framework and higher).
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeoutAction:Suspend
You'll have to update your Azure Cloud Service configuration file (.cscfg) to use OS Family 4, as outlined by scottgu in his blog post.
Since startup actions run when your instances are provisioned and before web application is deployed to IIS, by setting application pool defaults will defacto set your application apppool idel time out action to Suspend.