0

I'm very new to the Azure Event Grid and have a question on how to do something. I'd like to be able to register to receive events about VM activities (start/deallocate, etc) in a c#/.Net application in order to be able to react to certain VM events.

Has anyone done something like this? All the c# Azure Event Grid examples I can find seem to deal with getting notifications about items being removed from/added to blob storage in Azure.

mike w
  • 101
  • 1
  • 10
  • According to [Azure Event Grid](https://learn.microsoft.com/en-us/azure/event-grid/overview) official document, it seems that VM service is not supported by Azure Event Grid now. urrently, the following Azure services have built-in publisher support for event grid:+ Azure Subscriptions (management operations), Custom Topics, Event Hubs, Resource Groups (management operations), Storage Blob – Tom Sun - MSFT Jan 12 '18 at 07:54

1 Answers1

0

You can check this tutorial, it explains how to monitor VM changes:

In a nutshell:

  • Create a logic app with an eventgrid trigger.
  • Specify the resource group and resource (VM) name.
  • Filter the events you're interested in based on the operationname: @equals(triggerBody()?['data']['operationName'], 'Microsoft.Compute/virtualMachines/write')
Thomas
  • 24,234
  • 6
  • 81
  • 125
  • Is there any way where we can monitor internal services which are installed/deployed in the virtual machine ? for ex. : if any service is stopped (which was running for sometime) , would like to send this as event to event grid . is this possible ? – user2315104 Jan 19 '21 at 14:57
  • I imagine it is possible wih a little bit of code :-) – Thomas Jan 19 '21 at 17:59
  • Ohh , yeah. any reference to sample code would be much helpful :) – user2315104 Jan 20 '21 at 08:56