Unable to retrieve previous month's data from Azure Marketplace Cost API

Vishesh Agarwal 0 Reputation points
2025-05-05T13:07:07.0166667+00:00

In ADF, at a web activity:

I am using this API: GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01

With scope as: /providers/Microsoft.Billing/billingAccounts/{billingAccountId}

I want to fetch the Marketplace cost details for past month so i used the filter: $filter=properties/usageStart ge 2025-04-01 AND properties/usageEnd le 2025-04-30

URL: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/*****#######/providers/Microsoft.Consumption/marketplaces?$filter=properties/usageStart ge 2025-04-01 AND properties/usageEnd le 2025-04-30&api-version=2021-10-01.

But in response I only receive the data for current month may.

Please help.

 

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,486 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Smaran Thoomu 23,095 Reputation points Microsoft External Staff Moderator
    2025-05-05T13:43:48.13+00:00

    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:

    1. API Version Support The 2021-10-01 and even 2024-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.
    2. 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.
    3. 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:

    1. Try the latest supported API version: 2024-08-01 or 2023-11-01.
    2. Test the same request at a subscription scope (if applicable), e.g.:
         /subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces
      
    3. 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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.