Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudException: Internal Server Error when Using ListMetricsAsync Method #3769

Closed
AMoghrabi opened this issue Oct 7, 2017 · 7 comments
Closed
Labels

Comments

@AMoghrabi
Copy link

AMoghrabi commented Oct 7, 2017

I'm using Microsoft.Azure.Management.AppService.Fluent to collect information about my App Service Plans. The method I'm using is ListMetricsAsync.

My first problem is, the documentation says that the filter argument is optional. This is incorrect as the underlying web API throws an exception:

Microsoft.Rest.Azure.CloudException : Operation returned an invalid status code 'BadRequest'
Inner Exception: <Error xmlns:i="http://www.w3.org/2001/XMLSchema-instance\" xmlns="http://schemas.microsoft.com/windowsazure\">InvalidFilterValueParameterArgument Null\r\nParameter name: $filter

I've tried supplying an empty string but that does not work.

It looks like I must supply a filter so I try that... However, supplying a filter seems to return Microsoft.Rest.Azure.CloudException : Operation returned an invalid status code 'InternalServerError'
Here is my code:

    var appServiceManager = AppServiceManager.Authenticate(credentials, subscriptionId);
    var filter = "(name.value eq 'CpuPercentage') and aggregationType eq 'Average' and timeGrain eq duration'PT1H' and startTime eq 2017-10-06T19:00:00Z and endTime eq 2017-10-06T20:00:00Z";
    var metrics = appServiceManager.AppServicePlans.Inner.ListMetricsAsync("MyResourceGroupName", "MyAppServiceName", null, filter).Result;

I assume that my filter has incorrect syntax. Can you please advise what I need to do to get this working?

Thanks!

@hovsepm
Copy link
Contributor

hovsepm commented Oct 24, 2017

@shahabhijeet this is not Fluent specific. @AMoghrabi was using Inner to make a call which means that it was auto generated code. This needs to be investigated with the AppService team.

@hovsepm hovsepm added Websites and removed Fluent labels Oct 24, 2017
@AMoghrabi
Copy link
Author

Is there a different way to access that method without using inner?

@AMoghrabi
Copy link
Author

Also, should I open my issue on a different repository?

@ttugates
Copy link

I am experiencing the same issue. Any update?

@AMoghrabi
Copy link
Author

Hey

Check out my SO post about this -- someone replied with a decent solution:

https://stackoverflow.com/questions/46639014/azure-fluent-api-appserviceplanoperations-listmetricswithhttpmessagesasync-ret

@ttugates
Copy link

@AMoghrabi - Thank you!

@AMoghrabi
Copy link
Author

You're welcome! Good luck. ☺️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants