I have an azure worker role that reads from a queue. Occasionally, my instances will report themselves as unhealthy.
I know this happens from unhandled exceptions and I’m trying to get those fixed (that’s another matter).
I would like that role to auto-reboot any instances if they get into this unhealthy state. This would keep my instances, which are around five, running all the time.
I have logic to put any items that have been de-queued more than five times into a “poison” queue for me to review later. This ensures that the worker role instances don’t get stuck on the same queue item.
My question is: How do I auto reboot unhealthy worker roles?
You can get the Azure Fabric Controller to reboot your worker role by either:
In the case you described above the rebooting should already be occurring automatically.