使用Azure Application Insights REST API(https://dev.applicationinsights.io)读取自定义事件/指标

时间:2017-03-31 23:23:12

标签: azure azure-application-insights

我们的服务会将大量自定义事件和指标写入App Insights。 使用AI门户我们可以进行复杂的查询并查看漂亮的图表,但我想从门户外部访问数据。 Azure Application Insights REST API页面(https://dev.applicationinsights.io)声称这些API可用于执行此类任务,但我无法使它们工作 - 我想再查询自定义事件和指标,而不是标准事件和指标。 有没有人有任何例子? 以下是我们的查询之一:

customEvents
| where name startswith "Monitor.Xxxxxxx"
| summarize count() by bin(timestamp, 1min)
| order by timestamp desc

1 个答案:

答案 0 :(得分:0)

原来我使用了错误的AppId / Key;一旦我插入正确的,我就可以使用API​​ Explorer。