question

RaavanSuraj-9229 avatar image
0 Votes"
RaavanSuraj-9229 asked kobulloc-MSFT answered

Subscription level Alert

I have one subscription In Azure ,I would like to know. If any one creates one resources group ,It should send me an email notification stating that so and so person created a new resource group under this subscription . How can achieve this ? is there any inbuilt functionality to enable, if not what is my next step to achieve so?

Appreciate your help..!

Thank you .

azure-logic-appsazure-monitor
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Azure Event Grid is the service you would want to use and there is a write up on how to accomplish something very similar in the documentation:

(Edit - Apologies! This is the link I meant to paste)
https://docs.microsoft.com/en-us/azure/event-grid/monitor-virtual-machine-changes-event-grid-logic-app


I'm looking for something that will narrow the alert down to resource groups.


1 Vote 1 ·

Thanks for your help, Doc helps alot

1 Vote 1 ·

1 Answer

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered

There are a lot of options for accomplishing these kind of notifications and there is a blog by Tom Kerkhove that goes into the pros and cons of each approach:

https://blog.tomkerkhove.be/2020/01/20/how-azure-event-grid-is-different-from-logs-alerts-change-feeds-and-webhooks/


Azure Event Grid is a great option however you'll need to to find the operation for writing a resource group and I had difficulty tracking that down (alerts uses Microsoft.Resource/subscriptions/resourceGroups but that is incomplete). There's a good writeup on how to track changes to an individual resource which you might be able to adopt to your scenario which you can find here (use a Consumption Logic App for the tutorial):

https://docs.microsoft.com/en-us/azure/event-grid/monitor-virtual-machine-changes-event-grid-logic-app


Using Azure Monitor to create an alert may be another approach to look at. I would set the scope to the subscription and for your condition, set the signal to Create Resource Group. For actions, you'd want to set up an email notification:

https://docs.microsoft.com/en-us/azure/event-grid/set-alerts


111953-image.png


Additional resources:


image.png (366.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.