简体   繁体   中英

Get notified about Azure VM state change in .net code

We are using Azure libraries for .NET in order to provide some in-house UI to manage VMs that our employees use as test workstations.

So far we've successfully utilized the API to allow CRUD operations on VMs, as well as temp stop and de-allocation.

However, it is time to pump-up our responsiveness in the UI, and thus I am looking for a way for Azure to notify us via code subscription (or some other mechanism) that the VM's state has changed. We are happy to do a resource group bound notifications or per-VM monitoring, as long as it's not a polling approach where we just query the state time after time.

Is notification subscription possible when looking for VM state change info?

I have never done exactly what you are asking for but I think the right direction to look is Alerts and Azure Monitor .

You can set up an Alert for a sigle VM or a group of resources which will invoke a Webhook or send you an email message or push notification.

The simplier univesal scenario is to setup an alert based on performance metrics CPU/RAM to decide if VM is running or not. More complex scenario will be based on Activities (Service Health notifications, Administrator Activity Log, etc.) but all mechanisms are related to Azure Monitor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM