[英]How can I set up an alert for the creation of a new container in an Azure Storage Account?
每次在特定 Azure 存储帐户中创建新容器时,我都需要创建一个发送电子邮件的警报。
We don't have any built signals to create a Azure monitor alert to monitor the container creation in the storage account.我们没有任何内置信号来创建 Azure 监视器警报来监视存储帐户中的容器创建。
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.为此,您需要使用 Azure Monitor 并编写一个 kusto 查询来监控并在每次在存储帐户中创建新容器时发送电子邮件。
Below steps to be followed in-order to implement custom solution using Azure monitor:为了使用 Azure 监视器实施自定义解决方案,应遵循以下步骤:
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.单击日志分析空间中的New alert rule option
以使用上述查询作为信号创建自定义警报,如下所示。 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.在信号条件下,将Aggregation Granularity
(数据点按聚合类型分组的时间间隔。)、 Frequency of evalution
(确定警报规则的运行频率)设置为 5 分钟。
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.注意:这里我们使用自定义日志搜索作为条件信号,如果您想知道创建了哪个容器以及触发了此警报,请单击警报通知电子邮件中的Search Results
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.