Duration (Pacific Standard Time):
To (Pacific Standard Time):
Impact:
  • None
User Action:
  • None

RoleEnvironment.Stopping Event

Updated: December 6, 2013

Occurs when a role instance is about to be stopped.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
Public Shared Event Stopping As EventHandler(Of RoleEnvironmentStoppingEventArgs)
J#

The Stopping event is used to run code when a role instance is being stopped. This event is raised after the role instance has been taken out of the rotation of the load balancer, but before the OnStop method is called. You can use this event to run code that is required for a role instance to shut down correctly. The Stopping event is not raised when the virtual machine of the role instance is rebooted.

The following code example shows how you can run code when the role instance is being stopped:

No code example is currently available or this language may not be supported.

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms