Windows Azure Troubleshooting - Taking specific Windows Azure Instance offline
When you have lots of instances running on Windows Azure, you may need to investigate issues on a specific instance however there is not direct way, you can offline specific instance from your total instances. To investigate a specific instance your first requirement is to take that instance out of the network load-balancer so that you can enable offline troubleshooting. Azure Service Management portal does not provide such functionality however you can use PowerShell and Windows Azure cmdlets on the Compute nodes to remove your instance away from Load Balancer. To use it, you must have Remote login enabled on your Windows Azure application.
Here are the steps:
- Remote login to your specific instance you would want to make offline
- Launch PowerShell as Administrator
- Run command - Add-PSSnapIn Microsoft.WindowsAzure.ServiceRuntime
- Select ‘R’ to run the untrusted code
- Run command - ‘Set-RoleInstanceStatus –busy’
- Please leave PowerShell window open to keep instance in offline mode (If you will close the PowerShell window the instance will become Active again). You will also see a message about it in PowerShell command window.
- Now it will take about 2-5 minutes and after that time your specific instance will be off line.
The PowerShell command window look like as below:
Now let’s check the Windows Azure Management Portal for instance status:
To verify that we have offline the same instance run PS command “Get-RoleInstance –Current” as below”
After I close the PowerShell Windows my specific instance will become responsive again in next 2-5 minutes as below:
That’s it!!
Comments
Anonymous
May 11, 2012
If the instance is set to be offline, will it be still chargeable? Is there any way to set the instance offline with asp.net?Anonymous
May 14, 2012
For Windows Azure Compute, you will be charged all the time once application is deployed, until you delete it.Anonymous
October 23, 2013
The comment has been removed