Why consumption - usage details API returns 400 error?

Jaydeep Suryawanshi 26 Reputation points
2024-03-27T13:39:08.1366667+00:00

Hi Team,

We are using 'Azure cost management' connector in PowerBI to fetch usage details through 'Enrollment number', but we get error when we try to fetch data for 36 months. However, same thing is working when we reduce month duration to 24 months.

Please find below details

URL -

'https://management.azure.com/providers/Microsoft.Billing/billingAccounts/**/providers/Microsoft.Consumption/usageDetails/download?api-version=2019-11-01&$filter=properties/usageStart+ge+'2021-03-01'+and+properties/usageStart+le+'2024-03-27''

Error -

DataSource.Error: Web.Contents failed to get contents from 'https://management.azure.com/providers/Microsoft.Billing/billingAccounts/**/providers/Microsoft.Consumption/usageDetails/download?api-version=2019-11-01&$filter=properties/usageStart+ge+'2021-03-01'+and+properties/usageStart+le+'2024-03-27'' (400): Bad Request

Details:

*DataSourceKind=AzureCostManagement*

*DataSourcePath=Enrollment Number;***

*Url=https://management.azure.com/providers/Microsoft.Billing/billingAccounts/**/providers/Microsoft.Consumption/usageDetails/download?api-version=2019-11-01&$filter=properties/usageStart+ge+'2021-03-01'+and+properties/usageStart+le+'2024-03-27'*

Also, we observe the API version in this call is '2019-11-01', not sure if this API version is still valid. Could you please let us know how can we change API version in PowerBI if we need to upgrade it to latest version.

Thanks,

Jaydeep Suryawanshi

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,036 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. hossein jalilian 2,535 Reputation points
    2024-03-28T19:51:25.46+00:00

    Hello Jaydeep,

    Thanks for posting your question in the Microsoft Q&A forum.

    This article may help you:

    Billing Subscriptions - List By Billing Account


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful


  2. Monalla-MSFT 11,636 Reputation points
    2024-03-29T17:00:56.43+00:00

    @Jaydeep Suryawanshi - Welcome to Microsoft Q&A and thanks for reaching out to us.

    The API seems to work fine as expected when we tested it. I have confirmed the same with our internal product team here. Can you please retry and see if it's working now?

    If not, please let me know and we can investigate this further.

    Hope this helps. and please feel free to reach out if you have any further questions.


    Please don't forget to "Accept as Answer" and click "Yes" if the above response is helpful, so it can be beneficial to the community.