Forum Discussion
Azure Cost Management API & Power BI – Permissions, data access, and historical analysis
- 7 months ago
Hi akim_no , Thank you for reaching out to the Microsoft Community Forum.
This is a scope and billing-model mismatch, not a misconfiguration in Power BI. Azure Cost Management APIs are strictly scope-bound. You can query either subscription scope or billing account / billing profile scope, but you cannot mix them in a single request. The 404 you see on the CostManagement/query call is caused by an invalid ARM path where subscription scope is effectively nested under a billing account. That endpoint will always fail, even with correct permissions. Separately, several tables exposed under the billing account scope (for example balance or credits) rely on Consumption APIs that are not supported for all billing models (especially MCA), so Power BI shows them in Navigator but they return 404 or empty results at runtime. That is expected.
Permissions also have to align with scope. Subscriptionlevel cost queries require Cost Management Reader on the subscription. Billing account level queries require Billing Reader or Cost Management Reader at the billing account or billing profile. Having access at one scope does not imply access at the other. Empty Usage details previews usually mean you are connected at a billing scope where usage is not exposed the same way or there is no finalized invoice yet, this is common and not an error.
For architecture, the native Power BI Azure Cost Management connector is fine for exploration and short term analysis, but it is not designed for reliable historization. Microsoft’s supported pattern for long term, scalable cost analytics is Cost Management Exports to storage (ADLS/Blob), optionally processed via Data Factory or similar and then consumed by Power BI. If your goal is monthly trends over years with stable schemas and predictable refresh, exports are the correct and supported solution.
Microsoft Cost Details API now generally available for EA and MCA customers | Microsoft Azure Blog
Tutorial - Create and manage Cost Management exports - Microsoft Cost Management | Microsoft Learn
Azure Cost Management connector - Power Query | Microsoft Learn
I'm a little familiar with this but it's probably just a permissions/endpoint issue.
It would be good to check you have the following permissions:
- Cost Management Reader (or Contributor)
- Billing Reader
- Billing Account Reader (potentially too, but might not be necessary)
I think the endpoint you are calling returns metadata, not cost data, can you try
/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/query The Azure Cost Management Connector is pretty good link here.
A totally different workaround (depends on your data engineering ability or capability in your team) would be to export the cost data to storage (say a data lake partitioned by date) and query it from there instead.
I'd be interested to know if the permissions or endpoint were the issue. Good luck!
I tryed the endpoint :
/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/query
But I got this error :
DataSource.Error: Web.Contents failed to get contents from 'https://management.azure.com/providers/Microsoft.Billing/billingAccounts//subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/query%20/providers/Microsoft.Consumption/usageDetails/download?api-version=2019-11-01&$filter=properties/usageStart+ge+'2025-12-01'+and+properties/usageStart+le+'2026-01-15'' (404): Not Found
- JamieHolding7 months agoResolver I
Could you try again replacing {subscriptionId} with your Subscription ID.
Documentation Link- akim_no7 months agoHelper III
Yes that what I did