Hi Team,
I have a script which is fetching metric data for azure resource, lets say, SQL Data warehouse.
It works fine when running on Windows 2012 machine with any timegrain value given for GetAzureRmMetric API.
I used the same script on windows 2016 machine and it failed with an error :
Exception type: ErrorResponseException, Message: Microsoft.Azure.Management.Monitor.Models.ErrorRespons
eException: Operation returned an invalid status code 'BadRequest'
at Microsoft.Azure.Management.Monitor.MetricsOperations.<ListWithHttpMessagesAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Monitor.MetricsOperationsExtensions.<ListAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Commands.Insights.Metrics.GetAzureRmMetricCommand.ProcessRecordInternal()
at Microsoft.Azure.Commands.Insights.MonitorCmdletBase.ExecuteCmdlet(), Code: Null, Status code:Null, Reason
phrase: Null
Then I gave the timegrain as 1 hour in GetAzureRmMetric API and it worked but when I use any other value in timegrain, it fails.
Please help.