The issue you're facing likely stems from differences in permissions and configuration between Power BI reports and Paginated Reports in Power Automate and Power BI.
Here’s a breakdown of potential causes and solutions for the error:
1. Differences in API Permissions for Paginated Reports
Paginated reports and Power BI reports, even though they may use the same semantic model, are managed differently within Power BI. Specifically:
- Paginated Reports require additional permissions beyond what is needed for regular Power BI reports.
- Ensure that the user account running the Power Automate flow has the appropriate permissions to access and export Paginated Reports. This is crucial because Paginated Reports use different APIs (related to SSRS and paginated report services).
Steps to Verify Permissions:
- Go to Power BI Service and navigate to the workspace containing the Paginated Report.
- Confirm that the user has the correct roles (e.g., Member, Admin) in that workspace and explicit permissions on the Paginated Report.
- Check if the user running the flow has at least Read and Export permissions for the Paginated Report specifically.
Possible Solution:
- If permissions are missing, you can add the necessary Export permissions for the Paginated Reports at both the workspace level and the report level. This might involve asking your Power BI administrator to configure these permissions.
2. Different Licensing Requirements for Paginated Reports
Paginated Reports often require additional licensing compared to regular Power BI reports. While regular reports can run on Power BI Pro or Premium Per User (PPU) licenses, Paginated Reports often require a Power BI Premium capacity to export.
Check Licensing:
- Make sure that the workspace where your Paginated Report is located is backed by a Premium capacity.
- Additionally, ensure that the user account executing the flow has access to this Premium capacity.
Possible Solution:
- If the workspace isn't on a Premium capacity, and you don't have a PPU license, upgrading the workspace to Premium or purchasing the required license might resolve the issue.
3. API Differences Between "Export To File" for Regular Reports and Paginated Reports
Even though both the "Export To File for Power BI Reports" and "Export_To_File_for_Paginated_Reports" actions exist, they may use different backend APIs and handle security tokens differently.
Why This Matters:
- Paginated Reports use the Power BI Paginated Report API, which may handle authentication differently from regular Power BI reports.
- The 401 Unauthorized error suggests an authentication issue where the OAuth token used by Power Automate is not authorized to access the Paginated Reports API.
Possible Solution:
- Try re-authenticating the connection in Power Automate by:
- Going to Data > Connections in Power Automate.
- Finding the Power BI connection used in your flow.
- Re-authenticate or refresh the connection and ensure the user account has the right permissions (particularly for Paginated Reports).
- Check the authentication method being used by Power Automate for Paginated Reports and ensure that it's allowed by your organization's policy (e.g., OAuth token might be failing due to the way Paginated Reports APIs are handling the token).
4. Workspace Access Control Settings
If your Paginated Report is located in a different workspace from the regular Power BI reports, check the access control settings for that workspace:
- Go to the workspace in the Power BI Service.
- Ensure that the workspace settings, particularly for API access, are configured similarly for both regular and paginated reports.
- Test exporting the Paginated Report manually from Power BI to confirm if any configuration or export limits apply.
5. Ensure API Limits or Security Restrictions Are Not Blocking the Action
The 401 error might also indicate that something in the Power BI service is blocking the API request:
- Check if there are any API rate limits or security policies applied that may prevent the "Export_To_File_for_Paginated_Reports" action from being executed.
- Verify that the tenant settings in Power BI Admin Center allow the export of paginated reports through APIs.
6. Debugging the Response Format Issue (Non-JSON)
The error message about the response not being in JSON format likely stems from the 401 Unauthorized error. Since the unauthorized status code is being returned in HTML (not JSON), Power Automate is having trouble parsing the response. Once the 401 issue is resolved, the response format issue should go away.
Summary of Possible Steps to Resolve:
- Verify Permissions for accessing and exporting Paginated Reports (ensure Export and Read permissions).
- Check licensing requirements—ensure that you're using Power BI Premium or have the appropriate PPU license.
- Re-authenticate the connection in Power Automate for both Power BI and Paginated Reports.
- Test the API manually by exporting the Paginated Report directly from Power BI to confirm configuration.
- Review workspace and API access settings for any restrictions related to Paginated Reports.