I am currently developing a system that needs to have some decently accurate idea of the current state of a virtual machine scale set. I currently have it implemented by just polling the azure management apis. However, a bit concerned with the rate limits on the compute services particularly. So, need to set the poll intervals quite infrequently.
So, is there any ability to subscribe to Azure Virtual Machine status change events?
E.g., when an instance changes from status Running >> Deleting or when an instance goes from Running >> Updating is there some easy way to subscribe to events for that?
I have seen auto scale notifications and there are some resource group level events in the event grid that seem to sort of allow that functionality. However, based upon some testing, the auto scale events really only cover a small avenue for state changes. Specifically if an image version is updated you receive no information. Resource events in event grid could cover the gaps but the delay on the event grid events for VMSS changes seems to be something like 1-2 minutes so its not very useful for what i'm looking to develop.
Overall, is there a best solution here that i'm missing? An easy way to subscribe to all state change events for instances in a VM scale set? Or, are the auto scale events / polling the azure management apis approach the best options out there?