All, I am trying to deploy my cloud service to Windows Azure
. Currently It works fine. But I still try to understand the detail inside of it . Like below Power Shell
script.
The script is trying to get the status of a deplpoyment in the Staging
slot after New-AzureDeployment
has been executed successfully.
while ($True) {
$deployment = Get-AzureDeployment -ServiceName $CloudServiceName -Slot Staging
if ($deployment.Status -ne 'Running') {
continue
}
$notReadyList = $deployment.RoleInstanceList | Where-Object InstanceStatus -ne 'ReadyRole'
if (!$notReadyList) {
break
}
$errorStatusList = @('RestartingRole';'CyclingRole';'FailedStartingRole';'FailedStartingVM';'UnresponsiveRole')
$errorList = $notReadyList | Where-Object InstanceStatus -in $errorStatusList
if ($errorList) {
throw 'Role in staging fail to start for some of these reasons:' + ($errorList | Format-List | Out-String)
}
Start-Sleep -Seconds 10
}
I have some questions about the script . Please try to help me .thanks.
What is the object type of
Get-AzureDeployment
return ? I search it in the Help Doc. But did't found any information about it.How many possible status except
Running
theGet-AzureDeployment
could return ?Is there any possibility never break in the loop ?
Thanks.