No need to be sorry, Auto Download Tenant Consumption Reports

Published by Valentin Mazhar on , last updated on

Share

If you are responsible for the Power Platform Governance in the organization then you need to be able to monitor the platform usage and consumption. Some of this reporting is easily accessible from the Power Platform Admin Center (PPAC), but not everything is. Some specific tenant consumption reports can only be downloaded from the PPAC as csv files. This is the case for AI Builder, API Calls, Power Pages and Copilot Studio usage reports. You can only download them manually and they will contain the last 30 days worth of data. if you forget to extract them for a month, well, you will be sorry… Or you can automatically download these reports every day and never be sorry again!

Acknowledgements

Before we go any further, I want to give a big shout out to Laurent Careaux who told me that this is possible with an API and shared this PPRequestAnalyzer github repository from Nicolas Kirrmann. All the solution I am sharing in this article comes from Nicolas’ flows that I only slightly adjusted for this scenario.

What are these Reports?

From the Power Platform Admin Center, admins can go to Resources > Capacity > Download Reports to extract 4 main types of reports:

  • AI Builder: this report shows the AI Credits consumption per user per environment per day
  • Power Platform Requests (aka “API Calls”): these reports show the API Calls consumption per user per environment per day. A specific report is available for licensed users, non licensed users, and licensed flows
  • Power Pages: these reports show the app usage. A specific report is available for authenticated and for anonymous usage
  • Copilot Studio: these reports include the Copilot Studio legacy chat sessions and the more recent messages consumption per agent per day, both the tenant summary and the detailed environment reports. The Message Consumption reports are actually accessible via the new License Page of the PPAC (mentioned below).

All these reports have also a few things in common:

  1. Firstly, they are useful! They can help admins to better monitor the platform activity. This is key to anticipate demand and plan budget, but also to prevent service interruption issues if users overconsume their API call entitlements
  2. They don’t contain much information. They are merely actionable alone. Admins will want to cross this information with other data sources, such as the CoE Kit inventories
  3. When extracted from the PPAC, they contain the last 30 days worth of data. Admins cannot extract reports for different periods. This unfortunately means that if an admin forgets to extract a report for a period, they will lose the data…

So, considering the above, Admins have an obvious interest in storing such reports in a separate location to keep the history and draw some more advanced reporting from. Doing this automatically on a daily basis will save them some time and ensure to not lose data.

Note: since the first publication of this blog post, Microsoft released the Licenses page in the Power Platform Admin Center. This page provides some high level information about license consumption and now offers the option to download the Copilot Studio message reports. However it cannot be used directly customize and reports. It is then still relevant to extract the detailed consumption report on a daily basis for this purpose.

Download the Tenant Consumption Reports with the PPAC Reports Extractor

Overview of the Solution

Using the Power Platform Licensing API, it is possible to:

  • Programmatically extract tenant consumption reports from Power Automate
  • Define custom start and end dates for the reports (cannot be more than 45 days apart). This is true for all reports except for the recent Copilot Studio Message report, which can only be extracted based on the number of days to look back in the past.
  • Save these csv reports in SharePoint

⚠ Microsoft does not support the Power Platform Licensing API. It can literally stop working at any time. ⚠

This is exactly what the PPAC Reports Extractor solution does, which you can download from my GitHub repository.

The PPAC Reports Extractor works as below:

  1. Every day, the cloud Flow called “Daily Data Load Requestor” runs a child flow to extract each consumption report
  2. The child flow “Data Load Executor” runs once for each report. It downloads the consumption report for the previous day using the Power Platform licensing API, and save it in the SharePoint folder configured for this type of report. The detailed Copilot Studio message reports at environment level are extracted with another child flow called “Data Load Executor – CHILD – get Detailed Env Message Report”
  3. If any child flow fails, the parent flow sends an alert to an email address configured for this purpose
  4. A Canvas App is provided to allow admins to request the report download for a specific time frame. Once submitted, the flow “Manual Data Load Requestor” is executed and calls the “Data Load Executor” child flow accordingly which will in turn save the report in the appropriate SharePoint folder.
    Screenshot of the App included in the PPAC Reports Extractor solution

Follow the ReadMe instructions in my GitHub repository to install the solution.

Analyze these Reports

After importing this solution, the consumption reports are downloaded on a daily basis to SharePoint. And then what? You will likely want to connect to these reports with Power BI.

In the past I shared these two Power BI templates to analyze the Power Platform Requests and AI Builder consumption reports. Since these reports relied on manual extracts from the Admin Center, I have created a new Power BI template including 3 pages to report on:

  • AI Builder Consumption
  • Copilot Studio Consumption (I had built based on the legacy Chat Sessions consumption at the time. I will eventually update it to connect to the Message consumption instead).
  • Request Consumption for Licensed Users
  • Screenshot showing the PBI template to report on API Calls for licensed users
  • Screenshot showing the PBI template to report on API Calls for Non Licensed Users
  • Screenshot showing the PBI template to report on API Calls for Licensed Flows
  • Screenshot showing the PBI template to report on Copilot Studio Messages for the tenant
  • Screenshot showing the PBI template to report on Copilot Studio Messages per Environment
  • Screenshot showing the PBI template to report on AI Builder

You will find the template “Daily Consumption Report v2.pbit” in my GitHub repository.

Alternatively, Nicolas shares another Power BI template specifically for the Power Platform requests analysis on this GitHub Repository, more elaborated and even including an embedded Canvas App.


Share
Categories: Reusable Tools

22 Comments

Heather · June 19, 2025 at 9:18 pm

OMG!!! Valentin you are my hero. We’ve been dealing with this for months, trying to get our RPA team to try and make some kind of bot to download these files so we can automate license cleanups and whatnot and not getting anywhere and there was an api for this the whole time????? WHAT?! You just made my day.

    Valentin Mazhar · July 21, 2025 at 9:40 am

    Hi Heather, thanks for the great feedback ! I am glad this solution is helping

Fara · July 14, 2025 at 4:50 am

Hi Valentin,

We have noticed since 1st of July, this licensing API has stopped working and we cannot extract tenant capacity and receive a 403 , is this an issue for you too? we are using https://licensing.powerplatform.microsoft.com/v0.1-alpha/tenants/{Tenant ID}/TenantCapacity

    Valentin Mazhar · July 21, 2025 at 9:46 am

    Hi Fara, nothing is failing on my side that I can see…

    What are you trying to achieve with this endpoint specifically? Microsoft might be decommissioning some old endpoints (v0.1-alpha) to replace them with the new ones (v1.0).

    For now, it seems like none of the endpoints used by the PPAC Reports Extractor solution that I share here are impacted.

    Esz · October 1, 2025 at 4:49 pm

    Yes, we are seeing exactly the same issue unfortunately, which broke our automated capacity monitoring in Grafana.

      Valentin Mazhar · October 14, 2025 at 9:39 pm

      Hi Esz, I’d be happy to investigate with you to try to understand what is wrong, as the issue is not reproduced on my side.
      Feel free to reach out on LinkedIn and we can organize a Teams meeting? -> https://www.linkedin.com/in/valentin-mazhar/

    Valentin Mazhar · October 14, 2025 at 9:40 pm

    Hi Fara, I’d be happy to investigate with you to try to understand what is wrong, as the issue is not reproduced on my side.
    Feel free to reach out on LinkedIn and we can organize a Teams meeting? -> https://www.linkedin.com/in/valentin-mazhar/

Thomas Schwoerer · December 23, 2025 at 5:04 pm

Great content and information!! For each Data Load Executor – CHILD, i’m getting “HTTP request failed: the content was not a valid JSON. Error while parsing JSON: ‘Unexpected character encountered while parsing value: E. Path ”, line 0, position 0.'”

Any ideas?

    Valentin Mazhar · December 23, 2025 at 10:25 pm

    Hi Thomas, thanks for your comment and for raising this issue.

    I’m aware of this error and I’ve been investigating it, it started failing since December 18th.

    The API call itself is still the same when manually exporting the report from PPAC. It seems to rather be due to some change of policy at the endpoint gateway level on Microsoft side which might be rejecting the requests.

    I will update the related github issue when I know more 👉 https://github.com/ValentinMaz/Power-Platform-Samples/issues/11

      Valentin Mazhar · February 6, 2026 at 10:10 am

      Just letting you know here that the issue is now resolved in version 2026.01.29.2. It was fixed by replacing the action “Invoke an HTTP request” by the action “Get web resource” from the same HTTP With Entra Id (pre-authorized) connector.

        Thomas Schwoerer · February 18, 2026 at 10:04 pm

        Thanks! Validated it is now working.

          Valentin Mazhar · March 2, 2026 at 3:38 pm

          Awesome! Thanks for confirming

Steve · February 25, 2026 at 9:59 pm

This is awesome! Exactly what we need to track usage and hopefully billing/credit usage.

But I have a problem, the flows all run correctly without error, files are created in SP folders, but all the files only have column headers, no data. No matter what time periods I set, always blank data (bar the column headers).

Only 1 spreadsheet contains data: 2026-02-22_2026-02-23_PowerPlatformRequestsLicensedUsers

Any ideas why this may be? The user account running the flows (and used for all connections) has the Power Platform Admin role, and is System Administrator within the environment IDs set.

Thanks!

    Valentin Mazhar · March 2, 2026 at 3:45 pm

    Hey Steve, thanks for your comment – glad this solution helps

    A few follow up questions:

    1. When you download these csv reports directly from PPAC (https://admin.powerplatform.microsoft.com/resources/downloadreports), do you get some data or do they also come out blank for the same day(s)?

    2. What value did you set for the environment variables below?
    – PpacReportsNumberCopsLookbackDays
    – PpacReportsNumberSoonestReport
    – PpacReportsNumberDelay

      Steve · March 3, 2026 at 12:26 am

      Downloading the csv reports available directly from PPAC (https://admin.powerplatform.microsoft.com/resources/downloadreports), they are the same, only contain a header row (column names), no data. Except the “Power Platform Request Licenced User”, this csv contains data.

      – PpacReportsNumberCopsLookbackDays = 3
      – PpacReportsNumberSoonestReport = 3
      – PpacReportsNumberDelay = 1

        Valentin Mazhar · March 4, 2026 at 2:38 pm

        Hi Steve, thanks for confirming

        So if you generate a new report from PPAC and download it, it is also blank?
        If this is the case, then either you have an issue in the PPAC or there is no related activity in your tenant…

        Otherwise please feel free to each out on LinkedIn and we can schedule a screensharing session to troubleshoot -> https://www.linkedin.com/in/valentin-mazhar/

Ali · March 3, 2026 at 7:00 am

Hi Valentin,
Message Consumptions report which was working till yesterday has seems to stopped suddenly. Any Idea why would this happen?
More specifically, the flow “Data Load Executor – CHILD – get Detailed Env Message Report” and the action ‘Generate_Copilot_Studio_Env_Message_Report’ failed with below error.
The response is not in a JSON format.
with below error details.

{
“error”: {
“code”: 403,
“source”: “bda7cf75-cff3-e879-b443-805101d3efa4.12.common.uk.azure-apihub.net”,
“clientRequestId”: “18045ade-8442-4499-bcdb-36aef3762591”,
“message”: “The response is not in a JSON format.”,
“innerError”: “Cannot read server response.”
}
}

    Valentin Mazhar · March 4, 2026 at 2:36 pm

    Hi Ali, can you confirm that you have the version 2026.01.29.2 installed? I released a new version back in January to fix this issue, you shouldn’t be getting this error with the new version.
    Let me know!

      Ali · March 6, 2026 at 8:31 am

      Yes, I have the latest version 2026.01.29.2 . It was working till 2nd March and then broke after that. Seem something change in Microsoft Api after that.

        Valentin Mazhar · March 6, 2026 at 4:22 pm

        Thanks for confirming. I am now also experiencing the issue. It seems like the API Call to generate the Copilot Studio reports is rejected, most likely a change on Microsoft side

        I will investigate, the same issue must also be happening in the Copilot Studio Kit so I hope Microsoft will resolve

          Denis · March 23, 2026 at 1:16 pm

          It works only if you explicitly add the “Authorization” header with a raw bearer token. However, this is just a temporary workaround, not a scalable solution.

          Have you found any proper long-term approach?

          Valentin Mazhar · March 23, 2026 at 1:40 pm

          Hey Denis. That is correct, if you use the Bearer token from a logged in session in PPAC it works.

          No solution found so far.

          The issue is precisely that Microsoft seems to no longer authorize to acquire tokens externally for this endpoint. The issue is also impacting the Copilot Studio Kit, there is an open issue there with more information: https://github.com/microsoft/Power-CAT-Copilot-Studio-Kit/issues/628#issuecomment-4021991689

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *