-
Notifications
You must be signed in to change notification settings - Fork 377
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
Azure Billing Integration omit API version #7478
Comments
Pinging @elastic/es-distributed (Team:Distributed) |
@Gill-Bates, from your report, I see you are using the Elastic Agent version 8.9.0 to collect billing data using the Azure Billing integration.
I think you set the "Billing Scope Account ID" from the error message. Is it correct? |
@zmoog Yes, this is correct. I want to fetch the costs from the Billing Account Scope. |
I tried to reproduce this issue but failed. I need help getting this error. I tried using stack version 8.9.0 on two different Azure account types:
The call to Usage Detail API succeeded in both cases. I mention the account types EA and MCA because they have different behaviors in the billing area. Which Azure account type is your account? You also reported another issue with the billing account ID. At first glance, this problem may happen if the values contain only digits, but in my experience, the billing account IDs have characters other than digits, for example:
The billing account ID format looks like this What is the format of your billing account ID? |
@zmoog I have re-installed my entire Elasticstack. I summarize my environment: Elastic
My Azure Environment:
|
@Gill-Bates, let me double-check one more thing. All the accounts I can access, including my private one, have the If you open the following page, do you see the same digit-only codes? Cost Management + Billing > Billing Account > Settings > Properties > ID |
I was wrong in one of my previous comments. Both Azure accounts I used for my tests are Microsoft Customer Agreement (MCA) accounts. Cost management, billing data, and behavior can vary depending on the Azure account type. I need to get access to the billing account level data of the Enterprise Agreement (EA) account. I get back to you as soon as I can try on the same account type. |
Quick update: I am about to enable my app registration to access an EA account. I confirm EA accounts have a different Billing Account ID format; in my case, it's an 8-digit number, as you reported @Gill-Bates. |
We were able to reproduce this issue. It is not related to EA accounts; it also happens to MCA accounts. The problem occurs when there are more than 1000 usage details items in 24 hours, and the Consumption SDK needs to paginate the results. Root cause When there are more than 1000 usage details items, the Consumption SDK paginates the response. Each response page contains a 'next link' to the following page. The
Unfortunately, the Azure service adds the query parameters value to the 'next link' without encoding them. Since one of the parameters, Possible solutions The problem is in Azure SDK for Go (Consumption SDK) so it seems we can't fix it directly. However, we are already maintaining a fork of the Azure SDK for Go to address another SDK problem. See elastic/beats#37151 to learn more about our for of Azure SDK for Go. We added a small patch to our fork that URL encodes the next link value and avoids the 400 error. |
Thanks for the updates @zmoog ! Awesome! Have a great week! |
We are planning to release a fix for this bug in 8.12.0 and backport it to 8.11.2. |
Thanks for keeping me updated @zmoog ! Awesome job bro! Thanks! |
Elasticsearch Version
Version: 8.9.0, Build: deb/8aa461beb06aa0417a231c345a1b8c38fb498a0d/2023-07-19T14:43:58.555259655Z
Installed Plugins
No response
Java Version
JVM: 20.0.2
OS Version
Linux vmelastic 6.1.0-10-cloud-amd64 elastic/elasticsearch#1 SMP PREEMPT_DYNAMIC Debian 6.1.38-2 (2023-07-27) x86_64 GNU/Linu
Problem Description
When the integration makes a request against the Billing API, it must include the currently valid API version. It does not do that. Therefore, the integration is not functional.
Wrong (current behavior):
https://management.azure.com/providers/Microsoft.Billing/billingAccounts/1234567/providers/Microsoft.Consumption/usageDetails
Correct (expected behavior):
https://management.azure.com/providers/Microsoft.Billing/billingAccounts/1234567/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Steps to Reproduce
Logs (if relevant)
The text was updated successfully, but these errors were encountered: