0

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.

Edward Brey
  • 103
  • 1
  • 7

2 Answers2

0

While I'm not exactly sure of the AppPool name, you should be able to recycle an app pool with appcmd. For example:

appcmd recycle apppool /apppool.name: DefaultAppPool

You can also use PowerShell, by adding WebAdministration and executing Restart-WebAppPool. For example:

Restart-WebAppPool DefaultAppPool

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).

David Makogon
  • 2,768
  • 1
  • 20
  • 29
  • It's the bit about remotely performing the command on a virtual machine sitting across a load balancer from me that seems the trickiest. – Edward Brey Aug 02 '14 at 11:23
0

I'm late to the game, but can't you use the recycleApp provider directly from msdeploy?

Mac
  • 318
  • 2
  • 3
  • 10