Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
vojtechsima
Memorable Member
Memorable Member

Azure Cost Management - RI Usage Details - 400 Bad Request

Hi,

I wanna get data from Azure Cost Management, I use Enrollment Number and I have no problem getting other Tables (RI summary or Usage Details), however, for RI Usage Details I receive this error:

DataSource.Error: Web.Contents failed to get contents from 'https://management.azure.com/providers/Microsoft.Billing/billingAccounts/8735269/providers/Microsoft.CostManagement/generateReservationDetailsReport?api-version=2019-11-01&startDate=2018-05-01&endDate=2021-05-25' (400): Bad Request

Could you please clarify what's the issue?

1 ACCEPTED SOLUTION

Hi,

@v-luwang-msft 

 

I got it resolved by this article:

 

let
    enrollmentNumber = "<<Enrollment Number>>",
    optionalParameters1 = [startBillingDataWindow = "-9", endBillingDataWindow = "-6"],
    source1 = AzureCostManagement.Tables("Enrollment Number", enrollmentNumber, 5, optionalParameters1),
    riusagedetails1 = source1{[Key="riusagedetails"]}[Data],
    optionalParameters2 = [startBillingDataWindow = "-6", endBillingDataWindow = "-3"],
    source2 = AzureCostManagement.Tables("Enrollment Number", enrollmentNumber, 5, optionalParameters2),    
    riusagedetails2 = source2{[Key="riusagedetails"]}[Data],
    riusagedetails = Table.Combine({riusagedetails1, riusagedetails2})
in
    riusagedetails

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-connect-azure-cost-management 

View solution in original post

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @vojtechsima ,

Awesome! You can mark your answer as the correct answer so that users with the same problem can find a solution as soon as possible.

 

Best Regards

Lucien

v-luwang-msft
Community Support
Community Support

Hi @vojtechsima ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.

 

Best Regards

Lucien

Hi,

@v-luwang-msft 

 

I got it resolved by this article:

 

let
    enrollmentNumber = "<<Enrollment Number>>",
    optionalParameters1 = [startBillingDataWindow = "-9", endBillingDataWindow = "-6"],
    source1 = AzureCostManagement.Tables("Enrollment Number", enrollmentNumber, 5, optionalParameters1),
    riusagedetails1 = source1{[Key="riusagedetails"]}[Data],
    optionalParameters2 = [startBillingDataWindow = "-6", endBillingDataWindow = "-3"],
    source2 = AzureCostManagement.Tables("Enrollment Number", enrollmentNumber, 5, optionalParameters2),    
    riusagedetails2 = source2{[Key="riusagedetails"]}[Data],
    riusagedetails = Table.Combine({riusagedetails1, riusagedetails2})
in
    riusagedetails

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-connect-azure-cost-management 

v-luwang-msft
Community Support
Community Support

Hi @vojtechsima ,

The same problem occurred in February and the support department mentioned 60 to 90 days for a fix ,you could see the below:

Azure Cost Mgmt Power BI

 

Root Cause:

the issue is  on the Azure cost management APIs for payloads processing  , due to a backend (db) change on Azure cost Mgmt API side  , which essentially caused wrong response codes  on attributes on their end leading to NULL

attributes being passed and causing casting error when responding to payload requests from PBI calls. 

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors