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

  • Home
  • SEARCH
  • 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 7792827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:18:14+00:00 2026-06-01T22:18:14+00:00

How to I execute Reset-RoleInstance and wait for the operation to complete… I have

  • 0

How to I execute Reset-RoleInstance and wait for the operation to complete…

I have been attempting to use the windows azure powershell commandlets to execute Reset-RoleInstance followed by | Get-OperationStatus -WaitToComplete.

So the documentation says “This operation executes asynchronously. To determine whether the Management service has finished processing the request, call the Get-OperationStatus cmdlet with the operation ID returned by Reset-RoleInstance, and optionally wait for completion by specifying the –WaitToComplete parameter.”

I have tried this version:

Reset-RoleInstance -ServiceName MyTodo -DeploymentSlot production -SubscriptionId $subsId -Certificate $cert –reboot | GetOperationStatus -WaitToComplete

but this has a type in “GetOperationStatus”. So when I replace with “Get-OperationStatus”, PS complains that OperationId is null or empty.

“Get-OperationStatus : Cannot validate argument on parameter ‘OperationId’. The argument
is null or empty. Supply an argument that is not null or empty and then try the comman
d again.”

So, next I try this version of the PS script…

Reset-RoleInstance -ServiceName $serviceName -DeploymentSlot Production -InstanceName $i.InstanceName -SubscriptionId $subid -Certificate $cert -Reboot -OutVariable out | Get-OperationStatus -OperationId out.OperationId -WaitToComplete

This time, Get-OperationStatus starts throwing errors…

Get-OperationStatus : HTTP Status Code: BadRequest – HTTP Error Message: The operation request ID was not found … in Microsoft.WindowsAzure.Samples.ManagementTools.PowerShell.Services.Common.GetOperationStatusCommand

Get-OperationStatus : Object reference not set to an instance of an object…. in Microsoft.WindowsAzure.Samples.ManagementTools.PowerShell.Services.Common.GetOperationStatusCommand”*

I have also managed to print $out and OperationId is infact null BUT in the RoleInstances member of the output there is this value…
RoleInstances : {Instance Name: MyService.MyWorker_IN_0 – Operation Id: 6e87a07fb9a5474499aed3f9ebe99129}

Here is the output of the $out variable…
“RoleInstances : {Instance Name: MyService.MyWorker_IN_0 – Operation Id: 6e87a07fb9a5474499aed3f9ebe99129}
ServiceName : … my service name
SubscriptionId : … my subscription id
Certificate : … my certificate info

OperationId :
“

  • 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-01T22:18:15+00:00Added an answer on June 1, 2026 at 10:18 pm

    When you use Reset-RoleInstance, it either reboots/reimages the instances of the deployment.
    The whole operation as such does not have an OperationId but the individual RoleInstances have a corresponding OperationId each.

    This is how the output of Reset-RoleInstance looks like:

    PS > $operation = Reset-RoleInstance -ServiceName "MyServiceName" -DeploymentSlot "production" -Restart -SubscriptionId "MySubscriptionID" -Certificate $cert
    PS > $operation
    -
    RoleInstances  : { Instance Name: MyInst1 - Operation Id: OpId1, 
    -                  Instance Name: MyInst2 - Operation Id: OpId2 }
    
    ServiceName    : MyServiceName
    SubscriptionId : MySubscriptionID
    Certificate    : [Subject]
    -                ------- blah --------
    
    -                [Issuer]
    -                ------- blah --------
    
    -                [Serial Number]
    -                ------- blah --------
    
    -                [Not Before]
    -                ------- blah --------
    
    -                [Not After]
    -                ------- blah --------
    
    -                [Thumbprint]
    -                ------- blah --------
    
    OperationId    : <NullOrEmpty>
    

    As you can see the OperationId at the end is NullOrEmpty. So you should not be waiting on the OperationId of the Reset-RoleInstance but should be waiting on the OperationIds of the individual RoleInstances
    Eg: OpId1, OpId2

    PS > Write-Host "Rebooting the instances"
    PS > $operation = Reset-RoleInstance -Reboot -SubscriptionId $SubscriptionId -ServiceName $ServiceName -DeploymentSlot "Production" -Certificate $certificate
    PS > Write-Host "Waiting for all reboot operations to complete..."
    PS > $operation.RoleInstances | % { Get-OperationStatus -OperationId $_.OperationId -WaitToComplete -SubscriptionId $SubscriptionId -Certificate $certificate }
    PS > Write-Host "All role-instances have been rebooted"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I execute the ftp.exe cmd through a C# System.Diagnostics.Process type. And I use the
To execute my application in iPhone first of all I have to add provisioning
I have a cloned repo I use for the live site and I have
I have a query that I want to execute that fastest possible. Here it
Let's imagine I have two threads which execute some database-oriented code in thread-specific TransactionScopes
Does anyone have any idea why the following callback doesn't execute the code within?
After clicking an html reset button, <input type=reset /> I would like to execute
I have a JS script that changes content of webpages. I use this script
We are building a REST service that will take about 5 minutes to execute.
cursor.execute(SELECT user_id FROM myapp_location WHERE\ GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < %s\ ,(user_utm_easting, user_utm_northing, 500)); This

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.