Metrics for MS Azure role instance

Hi All,

I am using Service Management REST API for getting metrics for Azure role instance and able to get metric definition for the role instance using REST call. But when I tried to get metrics using following api call:

https://management.core.windows.net/<subscription-id>/services/monitoring/metricvalues/query?resourceId=/hostedservices/<service-name>/deployments/<deployment-name>/roles/<role-name>/roleInstances/<role-instance-name>&names=Disk Read Bytes/sec,Disk Write Bytes/sec,Network Out,Percentage CPU,Network In&timeGrain=PT1H&startTime=2015-09-06T11:12:39Z&endTime=2015-09-07T11:12:39Z

We are using certificate based authentication and sending request header "x-ms-version = 2013-11-01" but it is giving me following error:

[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD><TITLE>Bad Request</TITLE><META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD><BODY><h2>Bad Request</h2><hr><p>HTTP Error 400. The request is badly formed.</p></BODY></HTML>]

What could be the reason for this?

September 7th, 2015 5:53am

Hi Nithin,

I want to add one point here, when I tried to check this API call using Chrome browser rest client "POSTMAN", it is working fine and giving me expected response, no problem. 

But when I checked it using Java API HttpsUrlConnection, it is still not working. Is there any special header/parameter or something else we need to send with above request to get response. Because my all other api calls like get subscription, get hosted services are working fine with HttpsUrlConnection.

Please advice.

Thanks and Regards,
Pavan Kale

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 12:13am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics