How to set up an alert when a server is restarted in Azure

Occasional Contributor

Hi, I need to set up some kind of alert or receive an email when a server in Azure is restarted (this typically happens after applying patches to Windows or some other components).


Thank you very much




Carlos Negroni


2 Replies
best response confirmed by cnegroni (Occasional Contributor)

@cnegroni Hello,


  Is this a Windows VM?  If so, and if you have telemetry from the VM being captured into an Azure monitor workspace (Log Analytics agent overview - Azure Monitor | Microsoft Docs) you can query for this based on events reported in the event log:  Query for computer start events - Microsoft Tech Community 


If this is a Linux VM, there could probably be another way to query for this.  


If you don't have metrics being captured from the VM itself using the Azure monitor agent, the only other way to have insight into this is if the VM was started via the portal, command-line, etc. through the Activity log.  (See attached image).  We could setup a simple alert on this as well if this is what you're after.  Hopefully this helps!

@CloudyRyan thanks for your answer. I'll use the Activity Log (once it is activated because currently is it not being used in my company).