No need to be sorry, Auto Download Tenant Consumption Reports
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
- What are these Reports?
- Download the Tenant Consumption Reports with the PPAC Reports Extractor
- Analyze these Reports
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: this report includes the Copilot Studio messages consumption per bot per day.
All these reports have also a few things in common:
- 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
- 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
- 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, however it cannot be used to build custom and more detailed 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)
- 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:
- Every day, the cloud Flow called “Daily Data Load Requestor” runs a child flow to extract each consumption report
- 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
- If any child flow fails, the parent flow sends an alert to an email address configured for this purpose
- 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.
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
- Request Consumption for Licensed Users
You will find the template “Daily Consumption Report.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.
Feel free to subscribe if you liked the post
Don’t hesitate to share your thoughts in a comment! If you would like to see more posts like this then feel free to subscribe to this blog. You won’t be spammed, just informed when there is some new Power Platform related content.
0 Comments