I need to create an alert that sends an email every time a new container is created in a specific Azure storage account.
We don't have any built signals to create a Azure monitor alert to monitor the container creation in the storage account.
To accomplish this, you'll need to use Azure Monitor and write a kusto query to monitor and send an email every time a new container is created in the storage account.
Below steps to be followed in-order to implement custom solution using Azure monitor:
StorageBlobLogs
| where OperationName =~ "CreateContainer" and AccountName =~ '<StorageAccountName>'
| project Uri
New alert rule option
in the log analytics space to create a custom alert using the above query as signal as shown below.In signal condition, set Aggregation Granularity
(The interval over which datapoints are grouped by the aggregation type.),Frequency of evalution
(determines how often the alert rule should run) to 5 minutes.
Using Actions groups, you send an email or sms notification when the alert criteria has met. You can use the existing action group or you can create a new action group while configuring the alert.
Here is the sample image of the alert rule that was created using the above query:
Here is the sample output for reference:
Note:
Here we are using the custom log search as condition signal, if you want know which container got created and this alert got fired click on Search Results
in your alert notification email.