Hi @Vishesh Agarwal
Thanks for sharing the details.
The issue seems to stem from the API version or how the usageStart
and usageEnd
filters are being interpreted. A few things to check:
- API Version Support The
2021-10-01
and even2024-08-01
versions of the Marketplace Charges API may only support querying the current billing period. For some billing scopes, historical data might not be available through this endpoint — even if the date range is explicitly passed. - Scope Behavior When you're querying at the billing account level, some data may only be accessible for the current billing cycle due to restrictions in Marketplace data exposure. This is a known limitation for some scopes.
- Try Using Cost Management Exports For more reliable access to historical Marketplace costs, it's often better to use Cost Management Exports. These can be scheduled to push daily/monthly data to a storage account, which you can then read using ADF.
I would suggest following the below steps:
- Try the latest supported API version:
2024-08-01
or2023-11-01
. - Test the same request at a subscription scope (if applicable), e.g.:
/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces
- Consider setting up a Cost Export to capture historical data beyond current month reliably: https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/automation-overview
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.