如何获取Web应用程序服务的使用情况度量数据? [英] How to get the usage metrics data for the Web Application Service?

查看:71
本文介绍了如何获取Web应用程序服务的使用情况度量数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行REST API,以从Azure上部署的Web应用程序获取使用情况指标数据.

I am trying to execute the REST API to get the usage metrics data from Web Application deployed on Azure.

我正在尝试执行REST API,以从部署在Azure上的Web应用程序获取使用情况指标数据. https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/网站//指标?$ filter = startTime%20eq%202016-04-12T06:05:42.907Z%20and%20endTime%20eq%202016-04-12T06:10:42.907Z& api-version = 2014-04-01

I am trying to execute the REST API to get the usage metrics data from Web Application deployed on Azure. https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/sites//metrics?$filter=startTime%20eq%202016-04-12T06:05:42.907Z%20and%20endTime%20eq%202016-04-12T06:10:42.907Z&api-version=2014-04-01

但是我经常收到500 Internal Server Error.

But I am getting constantly 500 Internal Server Error.

此外,我试图在Mincrosoft.Web下的资源浏览器中找到给定的URL,但是我可以看到metricsDefinitions,但该指标不可用.

Also, I tried to find out the given URL in Resource Explorer under the Mincrosoft.Web But in that I can see the metricsDefinitions but metrics is not available for this.

有人可以让我知道如何获取Web应用程序服务的使用情况度量数据吗?

Can someone please let me know what how can I get the usage metrics data for the Web Application Services?

推荐答案

您可以通过Azure Insights API检索资源指标.通过使用Azure Insights API,可以以编程方式检索可用的默认指标定义(指标的类型)例如CPU时间,请求等),粒度和指标值.

You can retrieve resource metrics via the Azure Insights API.By using the Azure Insights API it is possible to programmatically retrieve the available default metric definitions (the type of metric such as CPU Time, Requests, etc.), granularity, and metric values.

https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}/metrics?api-version=2014-04-01&$filter={filter}

您正在使用的REST API URI似乎是正确的,但在此之前,第一步是对Azure Insights API请求进行身份验证.设置身份验证的最简单方法是创建一个Azure AD服务主体并检索身份验证令牌.

It seems the REST API URI you are using is right, but before that the first step is to authenticate the Azure Insights API request. The easiest way to set up authentication is by creating an Azure AD service principal and retrieve the authentication token.

https://blogs.msdn.microsoft.com/cloud_solution_architect/2016/02/23/retrieving-resource-metrics-via-the-azure-insights-api/.

这篇关于如何获取Web应用程序服务的使用情况度量数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆