0

I'm trying to create a Azure Logic App that will send an email if a Virtual Machine gets started. Is this possible and if so has anyone done this?

I've tried to modify the demo from the url Monitor virtual machine changes with Azure Event Grid and Logic Apps

changing the condition to check for to

@equals(triggerBody()?['data']['operationName'], 'Microsoft.Compute/virtualMachines/start')

But that doesn't seem to be working.

mike w
  • 101
  • 1
  • 10

1 Answers1

0

You need to filter for Event Type "Microsoft.Resources.ResourceWriteSuccess"

and check the condition:

@equals(triggerBody()?['data']['operationName'], 'Microsoft.Compute/virtualMachines/write'

Similar action can also be accomplished using Azure Automation in this tutorial https://learn.microsoft.com/en-us/azure/event-grid/ensure-tags-exists-on-new-virtual-machines

Bahram Banisadr
  • 312
  • 1
  • 7