How can I script (e.g. using PowerShell) the action to recycle the app pool of a web site hosted in a Web Role on Azure Cloud Services?
Only one instance of the cloud service is running (used for development). The reason for recycling is to work around a Web Deploy bug.
While I'm not exactly sure of the AppPool name, you should be able to recycle an app pool with
appcmd
. For example:You can also use PowerShell, by adding WebAdministration and executing Restart-WebAppPool. For example:
How you execute this would be up to you. Maybe execute it via remote PowerShell. Maybe execute it based on a command you send your web role instance (maybe via queue message or some other technique).
I'm late to the game, but can't you use the recycleApp provider directly from msdeploy?