iis 8 - Azure Appcmd startup task, setting preloadEnabled for ALL sites -
okay, i'm in process of implementing azure warmups using new iis 8.0 application initialization module.
i've got startup task (cmd file) cancels out idle timeout in iis , recycling time. i'm trying add application initialization that.
i realise need set 2 things; startmode
, preloadenabled
.
my application has numerous sites in iis (around 10), randomly named azure own randomly named application pools.
startmode
easy, can set application pool default doing:
%windir%\system32\inetsrv\appcmd set config -section:applicationpools -applicationpooldefaults.startmode:alwaysrunning
that applies application pools.
however, it's not easy preloadenabled
.
to set preloadenabled
, can use named site:
%windir%\system32\inetsrv\appcmd set config -section:sites [name='mysite'].applicationdefaults.preloadenabled
but need apply all sites don't know name of (they're random), kind of default (how have set startmode
).
any ideas?
after day of searching it, i've got it. uses loop in appcmd using pipe chain commands (kinda for
loop). here is:
%systemroot%\system32\inetsrv\appcmd.exe list app /xml | %windir%\system32\inetsrv\appcmd set site /in -applicationdefaults.preloadenabled:true
Comments
Post a Comment