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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
lkshck
Helper III
Helper III

Query Azure Cost Management API with POST Request

Hey,

I want to to query the Azure Cost Management API for Forecast Data with a POST Request in PowerBI. I only found the correct way with a GET Request, but this isn't working for this API, because it only support POST Requests. The current setup in PowerBI looks like the following:

 

let
    content = "{
""query"": [
{
   ""type"": ""AmortizedCost"",
   ""dataset"": {
     ""granularity"": ""Daily"",
     ""aggregation"":{
       ""totalCost"":{
         ""name"":""Cost"",
         ""function"":""Sum""
       }
     }
   },
   ""timeframe"": ""MonthToDate"",
   ""includeActualCost"":""true""
}
        ]
    }",
    Source = Json.Document(Web.Contents("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345678/providers/Microsoft.CostManagement/forecast?api-version=2022-10-01"))
in   
    Source

 

Here I'm just getting the following error:

 

DataSource.Error: Fehler beim Abrufen von Inhalten von "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345678/providers/Microsoft.CostManagement/forecast?api-version=2022-10-01" (405) durch "Web.Contents": Method Not Allowed
Details:
    DataSourceKind=Web
    DataSourcePath=https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345678/providers/Microsoft.CostManagement/forecast
    Url=https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345678/providers/Microsoft.CostManagement/forecast?api-version=2022-10-01

 

For me it looks like that Power BI still tries to do a GET request instead of a POST request. Authorization should happen via company Microsoft account which is already working fine for GET Requests to other Azure APIs.

I hope anyone could help me with this problem. Thanks in advance!

1 REPLY 1
aammirmirza
New Member

 progress on this query

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.