0
votes

I am trying to fetch metric values for a vm using below rest API :

https://management.azure.com/subscriptions/aac11d2f-f03b-454e-9f65-4eb00795f964/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/ubuntu/metrics?api-version=2014-04-01&$filter=%28name.value%20eq%20%27\Memory\Availableand%20timeGrain%20eq%20duration%27PT1M%27%20and%20startTime%20eq%202016-02-18T20%3A26%3A00.0000000Z%20and%20endTime%20eq%202016-03-23T21%3A26%3A00.0000000Z

But it is giving me an bad request URL. can any one help me out from this.

2
post the error that you are gettingfeargal
I am getting this error : { "error": { "code": "BadRequest", "message": "The request URL is not valid." } }Amol Shinde
@AmolShinde Did you want to use the REST API Get information about a virtual machine extension to get Azure VM metric data?Peter Pan
Hi Peter, No I don't want virtual machine extention, I want actual metric data of that VM like Percentage CPU, Disk read/writes per second like below : <MetricValue> <Timestamp>2016-03-18T19:00:00Z</Timestamp> <Average>0.32785945</Average> <Minimum>0.141114</Minimum> <Maximum>0.465757</Maximum> <Total>39.343134</Total> <Count>120</Count> </MetricValue>Amol Shinde
From here msdn.microsoft.com/en-us/library/azure/dn931939.aspx I can get the metric definitions but I can't get the metric valuesAmol Shinde

2 Answers

1
votes

Finally got API's to list the azure resource metrics sharing link of rest API's:

https://msdn.microsoft.com/en-us/library/azure/mt743622.aspx

0
votes

If you want to get the VM metrics from Azure Platform, you could follow these document.

Using Azure Storage service to storage your metrics and get metrics using storage SDK or Rest API whatever you used the classic mode or Resource Group Mode.

Please refer to official document about how to enable the diagnostics settings on Azure Portal : https://azure.microsoft.com/en-in/blog/windows-azure-virtual-machine-monitoring-with-wad-extension/ and how to use Azure storage REST API (https://msdn.microsoft.com/en-us/library/azure/dd179355.aspx) and SDK (https://github.com/Azure?utf8=%E2%9C%93&query=storage )

From your description, it seems that you used the Application Insight service to show your metrics on Azure. Actually, base on my experience, Application Insight service is in preview and it is design for your live App on Azure platform such as Web App, Android App and soon on.