Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:02:26+00:00 2026-06-07T10:02:26+00:00

The new Powershell cmdlets (documented here: http://msdn.microsoft.com/en-us/library/windowsazure/jj152841 ) look lovely, but there’s one that

  • 0

The new Powershell cmdlets (documented here: http://msdn.microsoft.com/en-us/library/windowsazure/jj152841) look lovely, but there’s one that appears missing:

Get-OperationStatus -WaitToComplete

Without this my Azure operations (e.g. Set-AzureDeployment) don’t wait for completion.

This makes it hard to know when e.g. a staging instance is running before doing a VIP swap.

Are there any alternatives?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:02:28+00:00Added an answer on June 7, 2026 at 10:02 am

    So, after investigation, my initial supposition was partly wrong: calls to the new Powershell cmdlets do wait for successful completion, except for Set-AzureDeployment -newStatus "Running".

    This is good, as we no longer need to have calls to Get-OperationStatus scattered through the script; it’s bad, though, as Set-AzureDeployment leaves the deployment spinning up.

    We can call Get-AzureDeployment, though, and iterate through the RoleInstanceList to figure out what’s going on. Like so:

    function Get-StagingReady {
        $stagingStatus = Get-AzureDeployment $azureService -slot staging 
        if (-not $($stagingStatus.Status -eq "Running")) {
            Write-Host $(" ... ... Staging slot status is not Running; value is " + $stagingStatus.Running)
            return $False
        }
    
        if (-not $stagingStatus.RoleInstanceList) {
            Write-Host " ... ... Staging slot has no instances configured yet."
            return $False
        }
    
        $notReady = $False
    
        Foreach ($roleInstance in $stagingStatus.RoleInstanceList) {
            if (-not $($roleInstance.InstanceStatus -eq "ReadyRole")) {
                Write-Host $(" ... ... ... Staging slot instance " + $roleInstance.InstanceName + " has status " + $roleInstance.InstanceStatus)
                $notReady = $True
            }
        }
    
        if ($notReady) {
            Write-Host " ... ... One or more instances not running."
            return $False
        }
    
        Write-Host " ... Staging slot ready for use."
        return $True
    }
    
    
    function Wait-ForStagingToBeReady {
        while ( -not $(Get-StagingReady) ) {
            Write-Host " ... ... Staging slot not ready, waiting 15 seconds for Azure to spin up instances."
            Start-Sleep -s 15
        }
    }
    
    
    function Start-Staging {
        Write-Host " ... Starting staging slot."
    
        $staging = Get-Staging $azureService 
        $result = Set-AzureDeployment `
                -Status `
                -serviceName $azureService `
                -slot "Staging" `
                -newStatus "Running" 
    
        if (-not $?) {
            Write-Host
            Write-Host "Unable to start staging slot."
            Write-Host "DEPLOY FAILED"
            Write-Host
            exit 1
        }
    
        Wait-ForStagingToBeReady
    
        Write-Host " ... Deployment in Staging slot started."
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Powershell v3 comes with all these new job-scheduling cmdlets. They look great, but I'm
I must be missing something basic here, but i'm new to powershell... I wrote
I am new in powershell but was wondering how do you get combination of
I'm fairly new to PowerShell, but have a strong C# background. The task I'm
In Powershell I am defining a new PSDrive called test . But when I
So I ran into this exact problem: http://www.vistax64.com/powershell/273120-bug-when-using-namespace-parameter-new-webserviceproxy.html The gist of the issue is
Im new to powershell - so serious noob. But I wanted to see if
I am new in PowerShell but am familiar with .NET classes. I am using
Powershell provides the New-WebServiceProxy cmdlet which allows for a web service proxy object to
I am new to PowerShell, I am trying to change a property of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.