Schedule IIS Reset on Azure Cloud Service -


i have azure cloud service requires warm when application pool comes online (typically 5-10 minutes). because of this, schedule iis\app pool recycle during off hours. when recycle takes place mid-day, users yelling @ me (and prefer not yelled at)

what i've been doing remoting vm, add cmd file local disk , create scheduled task runs cmd file:

net stop "world wide web publishing service" net start "world wide web publishing service" 

my problem is, periodically paas services "refreshed", randomly, code\files manually publish cloud service vm disappear. need remote machines , re-add cmd , scheduled tasks.

i know cloud services allow run startup tasks , like. can similar startup tasks allow me package cmd file when publish app, schedule these commands externally? if so.. how?

startup tasks may execute unattended app/installer include in .cspkg. need make sure cmd file in question bundled (e.g add configureschedule.cmd project, make sure it's copied output directory).

since you're attempting set scheduling, you'll need run cmd in elevated mode:

<startup>     <task commandline="configureschedule.cmd" executioncontext="elevated" tasktype="simple" >         <environment>             <variable name="myversionnumber" value="1.0.0.0" />         </environment>     </task> </startup> 

Comments