Search code examples
azureazure-alerts

How to create an Azure alert to notify about any resource deletion


Looking for some help around Azure alerts.

I need to get notified whenever any Azure resource is deleted. From what I have read so far I know an alert can be created at a resource level. But it will be too cumbersome to setup alert for each resource individually.

Ideally I would like to have a rule set up at Subscription level or Resource Group level which notify when any resource in Sub/ Resource group is deleted.

Will highly appreciate any help I can get with this.


Solution

  • you could, actually just stream activity logs to azure log analytics and then you could use a simple query like so:

    AzureActivity
    | where OperationNameValue endswith "DELETE"
    

    and then just click that + New alert rule button and your are all set.

    enter image description here