0
votes

I am facing one issue while calling the Azure usage api. In the usage API, we need to provide the reported start date-time and reported end date-time. In these date-times if I provide the minutes part like:

2017-02-09T03%3a30%3a00Z

Then it fails with exception- bad request.

It works fine with date-time part till the hour part. The moment any minute part is given, it fails. I tried to make sure that:

• both start and end datetimes are past to the current date time

• both the datetimes are provided in the utc iso 8601 format

• end datetime is after i.e. future to the start datetime.

As a result of the above issue, the minimum time gap between the reported date-times that I could go is one hour. Please let me know that I could try or anything wrong that I might be doing.

Thanks in advance,

Rahul

1
Have you tried using : instead of %3a?John Hascall
yes John, with ":" it fails even with the hour part saying bad requestRahul Bandopadhyaya

1 Answers

0
votes

If you use hourly granularity, it does not support minutes and seconds. https://msdn.microsoft.com/en-us/library/azure/mt219001.aspx

The body of bad request response should look like this: { "error": { "code": "InvalidInput", "message": "The reportedendtime for hourly aggregation granularity needs to have the time set using only the hours portion, with zeros for minutes and seconds (1:00:00Z, 2:00:00Z, 3:00:00Z, etc.)." } }