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, and Power Pages 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 3 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

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.

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)
  • 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
  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. These templates can be re-used although they will need to be slightly updated to work with this daily report approach as opposed to monthly.

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: Governance

0 Comments

Leave a Reply

Avatar placeholder

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