I have been working on a fairly feature rich Azure project for a year now. Having gone through Azure 1.1 to 1.6 has been both fun and interesting, but also trying at times because of various bugs.

After recently upgrading to the Azure November 2011 release 1.6 libraries and corresponding SDK the Azure project refused to run locally.

DevFabric startup would stop, with Visual Studio displaying the message “Role Instances are taking longer than expected to start. Do you wish to continue waiting?”

Azure WebRole will not start after upgrade to Azure November 2011 release (Azure 1.6)

The dreaded “Role Instances are taking longer than expected to start” message

Azure Compute emulator would stop at: [Diagnostics]: Starting configuration channel polling – before an error occured, a shutdown event was signalled, and the whole process would start over again.

Searching for the cause

A systematic search for the reason was the first and best option. A little googling revealed some possible causes:

  • Trace listeners could be causing the problem. Disabled all tracing, both sources and listeners, but no change
  • Service configuration change event handlers could be causing the problem. Disabled all of them but no change
  • The sites tag in ServiceDefinition.csdef could be causing the problem. Commented it out but no change

Finally I came upon the idea of disabling startup tasks. This had worked for a previous problem, and the application had a couple. This did in fact work – in isolation – so the startup tasks were causing the problem.

It is a pity because startup tasks used to work on the 1.4 and 1.5 releases of Azure DevFabric. At least the application will run locally again.

The startup tasks in ServiceDefinition.csconfig which had to be commented out:

      <Task commandLine="StartupTasks\InstallRootCert.cmd" executionContext="elevated" taskType="simple" />
      <Task commandLine="StartupTasks\FixDiagFolderAccess.cmd" executionContext="elevated" taskType="simple" />