api
2 TopicsIssue Exporting Power BI Paginated Report via API Using Service Principal
Hello Power BI Community, I’m currently facing an issue with automating Paginated report exports in Power BI using the REST API with a service principal. Everything seems to be working fine when I use a master user, but I’m running into issues when trying to use a service principal for the same task. Here’s a brief overview of what I’ve done so far: Set up a Service Principal in Azure Active Directory and granted it the necessary API permissions (e.g., Report.Read.All, Dataset.ReadWrite.All, etc.) for Power BI. Used the OAuth2 client credentials flow to authenticate and obtain an access token for the service principal. Successfully created a dataset using the Power BI API. Created paginated reports based on this dataset. Attempted to use the Export to File in Group API to export the report. When I try to export the report using the service principal, I’m encountering the following error: { "status": "Failed", "error": { "code": "Connection_Error_General", "message": "RootActivityId(4780ea99-6f13-4c9d-a18f-6f935b2ce05f): There was an error communicating with Analysis Services. Please verify that the data source is available and your credentials are correct.", "details": [] } } The export works perfectly fine when I use a master user for authentication, so the issue seems to be related to service principal authentication. Any help or pointers would be greatly appreciated! Thanks in advance for your help!Solved1.2KViews1like5Comments