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: