-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
API usage issues - TOP being ignored, timeout, etc. #22823
Comments
@msyyc can you take a look? |
Hello @OTDani ,I tried to solve your problem. Here is the code. I hope it will help you
|
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ccmbpxpcrew. Issue Detailsusing version azure-mgmt-consumption==9.0.0 The API .usage_details.list( Completely ignores the top clause, also if you use it '100'. The API also throws (429) Too many requests. Please retry after 60 seconds. Could you please advise on what is the correct way to use this API to get the current months all charges from Azure, to all subscriptions in our billing account / billing profile? Is there a way to govern to get back e.g. last 3 days only? The closest we get if we start to loop over each subscription separately - but this both seems a bad approach, as we have billing profiles and consolidated accounts - while also it is VERY slow - 6 accounts data jan 1 to 15 takes 13 minutes, and these are not even our big accounts. Thank you in advance Document Details⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
|
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
We are waiting on @ccmbpxpcrew |
Hi @OTDani, For some reason, the top parameter is indeed invalid in python sdk. @kazrael2119 provides an sample on how to use it to return only the results of the last three days. Hope it can help you. |
Thanks @BigCat20196 @kazrael2119 !!
Could you please double check this? As AFAIK it should be a billing profile id at the end, this throws an error 500.
but it runs, but not fine for just a subscription scope:
Returns 1 small account taking over a minute - 4474 elements - (I'm sitting on gigabit net)
|
Hi @OTDani , Python SDK is just tools to send/receive request/response. According to the context, it seems that server does not take the filter effect. Please follow https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/debug_guide.md to provide more detailed logs. With the logs, you could see the raw request and response from server. If the request is right with filters while server still return more data, it proves that there may be problems in server and you could make issue in https://github.com/Azure/azure-rest-api-specs/issues |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
using version azure-mgmt-consumption==9.0.0
The API .usage_details.list(
scope=f'/providers/Microsoft.Billing/billingAccounts/{billingAccountIdLong}/billingProfiles/{billingProfileId}'
,metric='amortizedcost',
top=100)
Completely ignores the top clause, also if you use it '100'.
The API also throws (429) Too many requests. Please retry after 60 seconds.
when you try to consume it.
Could you please advise on what is the correct way to use this API to get the current months all charges from Azure, to all subscriptions in our billing account / billing profile?
Is there a way to govern to get back e.g. last 3 days only?
The closest we get if we start to loop over each subscription separately - but this both seems a bad approach, as we have billing profiles and consolidated accounts - while also it is VERY slow - 6 accounts data jan 1 to 15 takes 13 minutes, and these are not even our big accounts.
Thank you in advance
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: