How to get the usage metrics data for the Web Application Service? - azure

I am trying to execute the REST API to get the usage metrics data from Web Application deployed on Azure.
Hi,
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
But I am getting constantly 500 Internal Server Error.
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.
Can someone please let me know what how can I get the usage metrics data for the Web Application Services?

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}
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.
A very detailed walkthrough at https://blogs.msdn.microsoft.com/cloud_solution_architect/2016/02/23/retrieving-resource-metrics-via-the-azure-insights-api/.

Related

How do I apply a policy from Azure API Management Service to Azure App Service route?

So, I was following this tutorial and successfully published the web API to both Azure App Service and Azure API Management. Then (going beyond tutorial) I added a rate-limit policy to the API in API Management service.
I tested it successfully on API management Test tab. However, if I access the App Service route URL (https://***.azurewebsites.net/) it will not throttle.
What am I missing here?
How do I make the policy active for the App Service URL?
Markus Meyer did a good job explaining how it's supposed to be used.
I think that you might benefit from this diagram showing the differences between calling your service through APIM or directly.
"What am I missing here?"
I think you're missing that API Management is a service, totally separate from you App Service. You do not "extend" the features of the App Service with APIM, you instead put APIM infront of your App Service and call your API through APIM to gain the benefits (of rate limiting in this example).
Requests to https://***.azurewebsites.net/ belong to Azure App Service.
If you want to do requests to API Management, the default hostname is azure-api.net:
https://***.azure-api.net/
If you want to use throttling from API Management, you have to the API Management URL like you did in the test tab:

Azure - monitoring resources using REST APIs

I am new to Azure and have been going through various tutorials.
I am looking specifically at Azure Monitoring using REST APIs.
What I am trying to do is get the status of various resources like Virtual Networks, AD, Load Balancers etc on a custom dashboard using REST APIs.
I have found some list of REST APIs that allow monitoring here(https://learn.microsoft.com/en-us/rest/api/monitor/)
But do they provide Resource health and Status.Also, do i have a create a new Service API Managament Resource(which is a paid resource) in the Azure Account for these APIs to run?.
Please let me know if you have any insights or reference materials on this
I don't think rest API is good for monitoring. I will suggest use Azure Monitor service under that you can use Azure resource metrics, Activity logs and service health. based on these metrics and logs you can set alert and show live data on the dashboard.
We are using Microsoft OMS for live monitoring (visualization of data) and Email/SMS for notification.
List item
Audit and receive notifications about important actions in your Azure subscription

Geo location /time zone in Application Insights

I have embedded Application insights telemetry in my azure cloud application, basically it’s a web based application.
I can see many things in azure portal after login, but unable to find geo location of request like we can see in Google analytic.
Can any one help me to find where I can see Geo location of request or at least time zone of request in azure portal?

Access azure website usage data inside of the ASP.NET app

We have a need to monitor the azure Web App's resource usage in relation to the number of users logged into the application.
What is the best way to get information about the running azure environment (processor and memory) usage of the Azure WebApp for an ASP.NET application.
You can try to setup Application Insights in your application. Once done you should be able to get telemetry data with their API
(https://msdn.microsoft.com/en-us/library/azure/dn931943.aspx?f=255&MSPPError=-2147217396)

Azure App Service API

Looking in the Azure portal, I can see monitoring charts for API apps and Web apps that return information on metrics such as number of requests, cpu time, data i/o, etc.
Is there an API that I can query that will return information on Azure app services?
If you just want to see the list of web apps within a resource group, this can simply be achieved using the Azure Resource Manager API, which is the default API used by the new portal.
We now even have a cool tool to explore these APIs, check https://azure.microsoft.com/en-in/blog/azure-resource-explorer-a-new-tool-to-discover-the-azure-api/
The API Reference itself is at https://msdn.microsoft.com/en-in/library/azure/dn790568.aspx
I think what you search is named : "Azure Monitoring Services API".
You can get/set metrics.
You can access to the API by a Nuget package :
PM> Install-Package Microsoft.WindowsAzure.Management.Monitoring
Yes, you can.
Please refer to Azure Insights REST API Reference.

Resources