How to Set IIS AppPool Start Mode to AlwaysRunning

Is there a way to set “Advanced Options” when creating an IIS App Pool?

More specifically, I am interested in setting the Start Mode to “AlwaysRunning” instead of the default “OnDemand”.

Hi Eric,

Thanks for reaching out. There isn’t a way to do it out of the box from the Deployment step, but you can always use powershell for such things:

  1. Enable Custom Powershell Scripts from the deployment step http://docs.octopusdeploy.com/display/OD/PowerShell+scripts#PowerShellscripts-Scriptsinpackagesteps
  2. Add this code snipped as a PostDeploy script and then run start a deployment
Import-Module WebAdministration #Make sure you have this module installed on your computer
$AppPoolName = $OctopusParameters['Octopus.Action[Name of your deployment step].IISWebSite.ApplicationPoolName']
$AppPool = Get-Item IIS:\AppPools\$AppPoolName
$AppPool.startMode = "alwaysrunning"
$AppPool | Set-Item -Verbose

*make sure to change the name of your deployment step on the Octopus variable accordingly *

Let me know if that works for you

Dalmiro