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

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.

Reply
ramila_bhimani
Regular Visitor

Power BI Post Rest API failed second time onwards

We are using Power BI rest API to get reports and copy it to one workspace to another. First time clone reports in group works fine, but after then this API with different report id always return 404 error. Report Id is correct and present in the workspace. Even I tried that on microsfot learing try it feature and there is also same behavior404Error.PNG

 

same happen to TakeOver rest API. 

2 ACCEPTED SOLUTIONS
ramila_bhimani
Regular Visitor

There could be some permission issue. Still could not figured it out. I have created separate workspaces and clone (post) Rest API working fine for new workspaces every time.

View solution in original post

ramila_bhimani
Regular Visitor

After 2 weeks trail and error, I found cause of the error. When I change workspace permission from Power BI service and after that the Rest API post request start giving 404 error even though the report present in the workspace. I do not know the reason for this. I had try to create new authenticate token for Rest API every time but it does not help. I know user permission does not relfect immediately in Rest API. that does not make any sense as I am using service principal and there is no permission changes for SP, so it should not fail.

View solution in original post

5 REPLIES 5
ramila_bhimani
Regular Visitor

After 2 weeks trail and error, I found cause of the error. When I change workspace permission from Power BI service and after that the Rest API post request start giving 404 error even though the report present in the workspace. I do not know the reason for this. I had try to create new authenticate token for Rest API every time but it does not help. I know user permission does not relfect immediately in Rest API. that does not make any sense as I am using service principal and there is no permission changes for SP, so it should not fail.

ramila_bhimani
Regular Visitor

There could be some permission issue. Still could not figured it out. I have created separate workspaces and clone (post) Rest API working fine for new workspaces every time.

ibarrau
Super User
Super User

Hi. Let's see. I would like to say two things.

First, if you are cloning the cloned report, it won't work. Cloning means creating a report that looks exactly like the original but connecting to the semantic model of the original report. If you want to clone that you might have issues. When cloned, reports with a live connection will lose that connection and instead have a direct binding to the target dataset. Maybe that can throw an exception.

Second, consider that the UI you are showing is just for testing purpose. If you want to clone many reports, you should write a code for doing it.

If you don't won't to clone and you are looking for something that really moves the report and it's semantic model, then it's a different request. SimplePBI Python library has created a method for copying between workspaces easy (combining two requests). You can read more about it here: 

https://blog.ladataweb.com.ar/post/697833112208539648/simplepbipython-copiar-pbix-entre-áreas-de

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Thank you for the details. Yeah basically we want to move report from 1 workspace to other workspace. And there is no API to move report so we clone the report in destination workspace and delete it from source workspace. Yes, we are using C# .net SDK to accomplish report movement. I do not understand error exactly as there is only Not Found error message "Operation returned an invalid status code 'NotFound'" and not error details. Report is present in source workspace, so is there any other component like dataset, datasouce missing? As I tries to export the report and I am getting same error message.

 

Once again, thank you for your help.

I'm not quite sure in which environment you are getting the 404. What I can see on your comment is that Clone is not the solution. Clone will create a replica of the report at destination connected with the dataset at source. However, if you want to move the whole thing you need to copy both of them from one workspace to the other. That would be exporting and importing the report with API.

The 404 means that it can't be found. Make sure that the report id hasn't change or it's correct for the second request.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors