Forum Discussion
Embedded Service CPU Issue with Power Apps Cloud Flow Requests
Hi mikeyoungCO -This behavior of the Power BI Embedded instance (A1) where the CPU usage climbs and doesn't drop after processing paginated report requests from Power Apps Cloud Flows could indicate a resource management or session handling issue specific to the requests originating from Power Apps.
Analyze the Load Pattern
Observation: Requests from Power Apps Cloud Flows appear to cause CPU usage to climb and not release resources.
Contrast: Requests from the Power BI web service or web apps appear to release resources as expected.
This suggests that requests from Power Apps might be keeping sessions alive or causing a resource leak.
2. Investigate the Cloud Flow Integration
Check how the Power Apps Cloud Flows are making API requests to Power BI:
Paginated Report API Call:
Verify if the flow is making multiple requests unnecessarily or if there's a lack of proper cleanup after the report is rendered.
Ensure the API calls use appropriate filters and are optimized to reduce report complexity.
Session or Connection Handling:
Some workflows or requests might inadvertently leave sessions open, causing resources to accumulate on the instance.
Confirm whether Cloud Flows close sessions properly after execution.
3. Review Report Complexity
The paginated reports may be causing the embedded instance to hold resources for too long:
Heavy Data Processing: Paginated reports with high data volume or complex queries may consume excessive CPU and memory.
Caching Issues: Check if caching is properly utilized. Reports with excessive on-the-fly computations may consume more resources.
Test simplifying the reports (reduce queries, pre-aggregate data).
4. Monitor Instance Performance
Use Azure Monitor or Application Insights to track resource utilization of the Power BI Embedded instance over time.
Specifically, monitor:
CPU usage
Memory utilization
Request patterns
Throttling or timeouts
5. Scale or Optimize the Instance
Scale the Capacity:
If the A1 instance is consistently maxing out, consider scaling to a higher SKU (e.g., A2 or A3) to accommodate the load.
Use the Autoscale feature to handle spikes dynamically.
Optimize Scheduling:
Schedule intensive Cloud Flows during non-peak hours to distribute the load.
6. Optimize Power Apps Cloud Flows
Batch Requests: If the flow sends multiple API requests in quick succession, consider batching them or introducing delays.
Use REST API Efficiently: Ensure that the flow leverages the Power BI REST API correctly, minimizing redundant requests.
Connection Throttling: Implement retry policies to avoid overloading the Embedded instance.
7. Test in Isolation
To confirm whether the issue lies in Power Apps Cloud Flows:
Create an identical flow but run it independently of Power Apps.
Test the API calls for paginated reports using tools like Postman or custom scripts.
Compare CPU behavior with and without the Cloud Flows.
8. Open a Microsoft Support Ticket
If none of the above resolves the issue, the problem may be related to how Power Apps interacts with Power BI Embedded resources. You can:
Provide Microsoft with the performance logs and explain the differing CPU behaviors.
Attach details of the Cloud Flows, paginated report specifications, and Embedded instance configuration.
What tools would we use to analyze the Power Apps Cloud Flow API calls?