I have a server application running on an Azure hosted virtual machine. This application consists of four windows services.
Every night I shutdown (deprovision) the virtual machine.
When I restart the machine, one of the four services fails to start. It's usually the same one.
If I then restart the machine, all four services start. If I stop the machine (leaving it provisioned) and then start it again, all four services start. It's only when the machine launches from the deprovisioned start the service fails to start.
I look in the event logs, and I see the following error:
A timeout was reached (30000 milliseconds) while waiting for the service to connect
I have tried configuring the Recovery options of the service so that it would Restart the Service after failing, with Enable actions for stops with errors: ticked. This has no effect.
My service code is a .NET application. I implemented logging, and made it log to a file as soon as it starts up. When it fails to start, no log entries are written. It's as if the application completely fails to load.
Is there a recommended way to approach this problem? (ie to diagnose the root cause, and to stop it happening).