-
Notifications
You must be signed in to change notification settings - Fork 50
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
get a timeout for (api) myapp/api/cspusage #28
Comments
Yeah, I'm also getting what I think are timeouts when the webjob gets the current cspusage records and puts them into the DB. If I remove the following code from the BillingWebJob project's CspDataHelper.cs file, then I'm able to at least get billing and historic CSP usage, but if this is left in, then the web job times out and crashes:
As the comments in the code note, you can increase the timeout in the web job config, but even with that at 30 minutes, I'm still getting a timeout. should I set it even longer than that? I'm querying about 20 different CSP tenants. I am getting CSP billing and historic data, so it seems like I have everything set up right, just can't get the CSP current usage to work. |
hi. I am checking with microsoft. aperently there is a hard code 4 minute timeout for Azure Webapp and it cant be bypass. |
Maybe it would be possible to alter the BillingDataApi so that we can call the API for CSPUsage on a per customer basis instead of all customers at once? perhaps that would allow the api call to finish faster? |
Ok, at least in my case, this is not a timeout, it's an exception thrown by the BillingDataApi CspUsageController.cs code. I was able to modify the code and have it just log the error to the application log in Azure, and here's the error being encountered (id's altered to protect the innocent): By removing the exception throw and changing it to just log to a trace, the data collection run completes and the API returns the CSPUsage data within a few minutes. Here's what I replaced the exception throw with:
Also had to add using System.Diagnostics at the top of the CspUsageController.cs to use Trace. I can send a pull request if you want, but there might be a better solution by filtering the customers pulled from the PartnerCenter to ensure there is a valid reseller agreement. |
Yes, the issue here (in my case at least) is that we have customers in the partnercenter that we only have an "Advisor" relationship with, not a "Reseller" relationship. So probably the best solution is to pull only customers with a Reseller relationship from the partnercenter api, not all customers. |
We have made the usage API async. It can be viewed at the CSPUsageAsync branch(here). I request you to test the API project on this branch and let us know if it works |
No description provided.
The text was updated successfully, but these errors were encountered: