Search code examples
azurerolewebrole

Role Instances are taking longer than expected - Workaround issues


Whenever we get the error "Role Instances are taking longer than expected". The only possible options to do are .

  • Shutdown the emulators and try again.
  • Restart the machine and see if that helps.
  • Uninstall the Azure Tools for that version.

Some times uninstalling the same takes a long time,some times even days. It appears that some process or service is blocking the same. Has anyone faced this before ? If yes does anyone know which process would be blocking the same?


Solution

  • When an instance starts it will run the OnStart method on the worker/web role (depending on your service type). The more stuff you have in there, the more time it will take to start up the role. Common caveats are the Cache as mentioned and blob/table storage (if you do read/write/create when you start the role).

    Try minimizing the OnStart's workload and moving any storage stuff in async tasks.