简体   繁体   English

如何为在 Azure 存储帐户中创建新容器设置警报?

[英]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 监视器实施自定义解决方案,应遵循以下步骤:

  1. Create a log analytics workspace.创建日志分析工作区。
  2. Enable the Diagnostic settings on the storage account and send these logs to the above Log analytics workspace.在存储帐户上启用诊断设置并将这些日志发送到上述日志分析工作区。
  3. Here is Kusto query to pull the Create Container operations on the storage account:这是 Kusto 查询,用于在存储帐户上拉取 Create Container 操作:
    StorageBlobLogs
    | where OperationName =~ "CreateContainer" and AccountName =~ '<StorageAccountName>'
    | project  Uri
  1. click on 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以使用上述查询作为信号创建自定义警报,如下所示。

在此处输入图像描述

  1. 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 分钟。

  2. 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.

相关问题 如何在 Azure 存储帐户容器中获取有关“老化文件”的警报? - how can get an alert on “aged files” in Azure Storage Account Containers? 如何为 azure 中的存储容器创建容量警报 - How to create capacity alert for storage container in azure Azure Blob存储-在将新文件上传到Blob容器中的特定文件夹时设置警报 - Azure Blob Storage - Set an alert when a new file is uploaded to a specific folder in a blob container Azure 存储帐户容器 - Azure storage account container 当某人在蔚蓝中进行VIP交换时,如何设置警报以发送电子邮件 - How can I set up an alert to send an email when someone does a vip swap in azure 如何判断Azure存储帐户的完整程度? - How can I tell how full an Azure Storage account is? 如何在 azure 容器创建中指定 docker 运行参数 - How can i specify docker run argument in azure container creation 如何将现有的 Azure 存储帐户连接到专用链接? - How can I connect an existing Azure storage account to a private link? 使用 ARM 模板对 Azure 存储帐户容器设置合法保留 - Set legal hold on Azure storage account container with ARM template 我如何设置我的Azure帐户以通过REST API进行ARM部署? - How can I set up my Azure account in order to make ARM deployments via the REST API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM