Minal
Minal

Reputation: 51

How to get Azure Role Instance using Windows Azure Powershell commands

I am trying to get Azure Instances for a deployed service and then to check if all the instance statuses are "Running". How can I accomplish this with the Windows Azure Powershell cmdlets?

Upvotes: 2

Views: 4257

Answers (1)

MikeWo
MikeWo

Reputation: 10985

Here is the command you are looking for:

$NonReadyInstances = (Get-AzureDeployment mikewoazuredemo -Slot Production).RoleInstanceList | Where-Object { $_.InstanceStatus -ne "ReadyRole" } | ft -Property RoleName, InstanceName, InstanceStatus    

$NonReadyInstances     

This will get you list of any Instance in any role that isn't in the ready status. If you want the ones that are ready change the -ne to -e in the Where-Object. The statuses for instances can be found in the REST API Documentation for the Get Deployment operation which this cmdlet calls under the hood.

Upvotes: 10

Related Questions