如何在 Azure App Insights 中查看 Blob 存储日志?

问题描述

我刚刚将一个 Blob 上传到 Azure Blob 存储容器。几乎立即,当使用 Azure 存储资源管理器查看时,.log 文件中有一个条目:

enter image description here

如何使用 Application Insights 查看这些日志(或类似日志)?

似乎有任何数据的唯一 App Insights 表是 AzureActivity 表,但它只显示 List Storage Account Keys 活动,而不是上传的 blob 的实际文件名/大小/等。>

enter image description here

StorageBlobLogs 为空(这是数据所在的最合理的听起来表):

enter image description here

AzureMetrics 也是空的:

enter image description here

解决方法

您的要求可以实现,但也许您需要做一些自定义过滤器。

首先,storage的日志分析不会记录这些东西。

您需要将日志发送到 Log Analytics workspace

enter image description here

enter image description here

enter image description here

而且操作名会有点不同,比如'create blob'会变成'put blob'(这是因为最基本的交互行为都是通过rest api实现的,所以需要找到rest api request对应每个行为。之后你就可以知道对应行为的名称。)

This 是官方文档,你可以查一下。