
Explanation
Step 1: an Azure Event Grid trigger
First add an Event grid trigger that monitors the resource group for your virtual machine.
Step 2: a conditional control
To run your logic app workflow only when a specific event happens, add a condition that checks for virtual machine "write" operations.
Step 3: an action
Now add an action so that you get an email when the specified condition is true.
References:
https://docs.microsoft.com/en-us/azure/event-grid/monitor-virtual-machine-changes-event-grid-logic-app