Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm attempting to use "Export-PowerBIReport" with service principle authentication to export a .pbix file to a local drive. I keep receiving the "Forbidden" error. Is this not possible with a service principle? I have also attempted to run this via powershell within a devops pipeline using an on-premise agent but again the same error is received. I can run Get-PowerBIReport with no issues via the service principle and I can use a domain account with PBI and local drive permissions to export the .pbix but how can I do this with a service principle? Ultimately I want to run this within a devops pipeline for archiving automation purposes.
Any help appreciated.
Thanks.
Solved! Go to Solution.
I figured this out. Along with the admin portal/developer setting api permissions for service principals, they also need to be granted the permissions to download .pbix files:
I figured this out. Along with the admin portal/developer setting api permissions for service principals, they also need to be granted the permissions to download .pbix files:
Hi,
Thanks for your reply. I can confirm that all the above has been set. I can run all API commands except "Export-PowerBIReport" via the service principle. If I use a domain account with PBI admin access and the export location access the "Export-PowerBIReport" command works. Can you confirm the Export command is a limitation with the service principle? Is there anyway to impersonate a domain account with service principle authentication to successfully export? I need to use service principle to avoid authentication prompts when running my Powershell tasks within DevOps pipelines.
Thanks.
Hi @powerbi_jenhen ,
First, please check whether you enable the following Power BI service admin settings in Admin portal:
1. Allow service principals to user Power BI APIs
2. Allow service principals to use read-only Power BI admin APIs
Then make sure that grant the access to the the workspace which the report located in with memeber or admin role.
And please check whether hit any following limitation of downloading a .pbix from a report
In addition, the following is the threads which has the same problem with yours. Hope they can help you.
Allow Export-PowerBIReport Is not working as admin #65
Permissions needed for Service Principal #51
Service Principle cannot Get-PowerBIWorkspace
Best Regards
My service principle has access to all Power BI Service scopes within our AAD application also
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |