Whenever a Windows Azure role is stopped its OnStop()
method is invoked. Turns out that there's RoleEnvironment.Stopping
event that is triggered before OnStop()
is invoked. MSDN says this event is the right place for role clean shutdown code.
What's the difference between the two? Why would I put role clean shutdown code in Stopping
event and not in OnStop()
method override?