Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Update report content using rest api returns Unauthorized

I'm trying to create a functioning CI/CD setup. Using UpdateReportContent I want to update the Production report with the Test report.

I'm calling the REST API using the Service Principal and it all works fine for other stuff, i.e. getting reports, uploading pbix files.

The SP has admin rights to both Test and Production workspace. The Service Principal also have the correct permissions (Report.ReadWrite.All) registered in the App Registration in Azure AD.

I've tried this using Postman and by calling the REST API with Powershell, both with the same 401 Unauthorized result. 

 

However when I use the "playground / try it" here signing in with my own personal account (which also have admin rights) i can update the report. The request body I used is the same as the one from postman, therefore verifying that my json body is correct.

 

Anyone who have been able to update the report using the REST api with Service Principal ?

 

Response: 

{"error":{

"code":"PowerBINotAuthorizedException",

"pbi.error":{

"code":"PowerBINotAuthorizedException",

"parameters":{},

"details":[],

"exceptionCulprit":1

}}}

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Update: I found that Clone (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/clonereportingroup) report works over different workspaces so I decided to go with that solution. 

One problem with it is that it does not replace a report if there's a name conflict, and I can't choose to specify a report id to replace. So what I did was to get reports (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/getreportsingroup) and extract the one with matching name and do a delete (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/deletereportingroup) on that report. 

Then I clone the report I want moved by specifing the dataset I want to use in the other workspace.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

It works when the reports are in the same workspace, just tried it by calling the rest api with powershell. 

 

Is this a limitation with Service Principal ? That you can't Update report content with reports from different workspaces

Anonymous
Not applicable

Update: I found that Clone (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/clonereportingroup) report works over different workspaces so I decided to go with that solution. 

One problem with it is that it does not replace a report if there's a name conflict, and I can't choose to specify a report id to replace. So what I did was to get reports (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/getreportsingroup) and extract the one with matching name and do a delete (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/deletereportingroup) on that report. 

Then I clone the report I want moved by specifing the dataset I want to use in the other workspace.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.