Set-RoleInstanceStatus

Remove the instance from service to facilitate debugging. When the instance is set to busy by using this cmdlet, the instance is not considered by the load balancer.

Syntax

Set-RoleInstanceStatus –Busy [<CommonParameters>]

Set-RoleInstanceStatus –Ready [<CommonParameters>]

Description

The Set-RoleInstanceStatus cmdlet either removes a role instance from the load balancer with the –Busy parameter or adds it back to the load balancer with the –Ready parameter.

When you run this cmdlet you will see the following warning:

WARNING: Role instance status set with Set-RoleInstanceStatus will only remain in effect for the duration of the PowerShell session in which the cmdlet was executed.

If you close the PowerShell window, the role instance returns to the Ready state if no other processes are causing the role instance to be Busy. Additionally, the role instance status is not updated until the next time the RoleEnvironment.StatusCheck event is raised.After you finish debugging, the role instance needs to be returned to service. To do this, you can either close the PowerShell session or use the –Ready parameter.

Parameters

-Busy

Sets the status of the current role instance to busy.

Required?

true

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Ready

Sets the status of the current role instance to ready.

Required?

true

Position?

named

Default Value

None

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and –OutVariable. For more information, see about_CommonParameters

Example 1

Set-RoleInstanceStatus -Busy

Description
--------------
This command sets the status of the current role instance to busy, which enables you to debug issues or make updates without the interference of external activity.

Example 2

Set-RoleInstanceStatus -Ready

Description
--------------
This command sets the status of the current role instance to ready, which makes the role instance available for external activity.

See Also

Concepts

Windows Azure PowerShell Cmdlet Reference
Defining the Settings for an Application