首页 > 解决方案 > KQL 时间表可视化显示特定资源随时间的总数

问题描述

我正在尝试在 Azure 资源图中随时间推移可视化特定资源的总数。

例如,2018 年应用洞察总数为 10 个,2019 年总数为 20 个,依此类推。

这是查询,但它有问题: 1- 它不聚合资源的总数 2- 它不接受渲染时间表

resources
| where type == "microsoft.insights/components"
| extend CreationDate = todatetime(properties.CreationDate)
| summarize count() by bin(CreationDate, 365d)

标签: azureazure-log-analyticskqlazure-resource-graph

解决方案


您需要将资源添加到 by 子句,例如,如果您有一个名为“资源”的列,请使用:

resources
| where type == "microsoft.insights/components"
| extend CreationDate = todatetime(properties.CreationDate)
| summarize count() by bin(CreationDate, 365d), Resource

关于渲染时间表不起作用,您是否检查过您有超过 1 年的数据?如果是这样,您能否提供您正在试用的应用程序的更多详细信息?那是应用程序洞察力吗?


推荐阅读