azure - 通过分析 Azure 日志发送警报

标签 azure azure-functions azure-alerts

我正在使用一个写入日志的azure函数:

def main(name: str) :

connect_str = os.getenv('AzureWebJobsStorage')
blob = BlobClient.from_connection_string(conn_str=connect_str, container_name="testcsv", 
blob_name=name)
exists = blob.exists()

if (exists == False):
    logging.info(f"The blob exists \n")

else:
    logging.error(f"The blob does not exist \n")
    

return exists

当我在日志中发现“该 blob 不存在”时,我想发送警报。我想我必须在警报中使用自定义日志搜索。你知道怎么做吗?

最佳答案

警报始终由遥测查询触发。如果我们可以制定一个查询来揭示不良行为,我们就可以针对不良行为设置警报。

到目前为止,我们可以创建自定义警报,即基于结果数指标测量

请参阅Microsoft Blog on Alert based on Analytics query using Custom Log Search了解更多信息。

关于azure - 通过分析 Azure 日志发送警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72458847/

相关文章:

azure - 将其他收件人添加到自动 "action required"电子邮件中

json - Azure 常见警报架构将 commonPropertie 设置为 "null"

Azure DevOps 安全信息存储

azure - 写入 Azure Blob 存储。一切看起来都很好,但它创建了很多临时文件

.net - 打包/发布Azure项目时出现System.OutOfMemoryException

Azure函数表绑定(bind): How do I update a row?

Azure AKS 主节点架构

azure - 如何在门户仪表板中再次显示Azure Function

azure-active-directory - Blazor WASM 调用 Azure AAD 安全函数 API

azure - 如何在 Azure SQL MI 实例上设置针对已用存储空间百分比的警报?