Jim posted about the RoleEntryPoint methods and call order in Windows Azure. In the case of a Worker Role, the RoleEntryPoint class is the class you derive to write your code. When you create a new Worker Role project in Visual Studio, you’ll see that the project contains one code file and in that code file there is a class called WorkerRole that derives from RoleEntryPoint. Worker Role Call Order: WaWorkerHost process is started. 1. Worker Role assembly is loaded and surfed for a class that derives from RoleEntryPoint. This class is instantiated. 2. RoleEntryPoint.OnStart() is called. 3. RoleEntryPoint.Run() is called. 4. If the RoleEntryPoint.Run() method exits, the RoleEntryPoint.OnStop() method is called . 5. WaWorkerHost process is stopped. The role will recycle and startup again.
Full Article: RoleEntryPoint Method Call Order