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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
matvi
Frequent Visitor

REST API Usage: Reports - Update Report Content vs Clone vs Import

Hi, 

I'm writing a program to copy a workspace content to another one using the REST API. I've looked at the tutorial by Sirui Sun, but his example doesn't work if there are already reports in the target workspace.  

I see that there is 3 different ways of creating/updating a report and some documentation comparing each approach would be very appreciated. My understanding is:

1) Export and import the pbix: This can be used to create or update a report. It's the best option to create the datasets. The downside is that you have to download and upload everything so very unefficient. 

2) Clone report: From my tests, this will create a new report each time, so it can't be used for updating. It that true?

3) UpdateReportContent: I looked at the documentation and it doesn't really say much. My understanding is that, to update a report based on an existing one, this is the way to go. But in the request definition, there's a sourceType. What the **** is a sourceType. I've seen some example putting sourceType="ExistingReport", but what does that do and what are the other options?

 

Thanks 

Mathieu

 

2 REPLIES 2
TedPattison
Microsoft Employee
Microsoft Employee

I wrote a c# console application a while back to clone app workspace content. It is still a work in progress but it will help you get started.

 

Here is the approach I am using 

  1. Export/import all the PBIX projects you have created with Power BI Desktop. However, you must filter out reports that have been created in the browser or reports that are not paired with a dataset in a single import.
  2. Clone all dashboards and thier tiles (my code shows how to do this)
  3. Clone reports that were not cloned by export/import in step #1 (my code does not contain this functionality yet)

 

Here is the code which you can use as a starting point.

 

https://github.com/CriticalPathTraining/PBD365/blob/master/Modules/07_PBIRestApi/Demo/ClonePowerBiWo...

Thanks for your answer. I did something similar in Python. The main difference is that I only exported/imported pbix for reports defining datasets. I don't like that download/upload thing so for the left reports, I cloned the new ones and updated existing ones.

 

I was wondering how you handle the Azure Usage Metric report? 

Also, I see that you have some code to update the datasource credentials. Have you faced the issue of ownership? I wrote a method to take the ownership of a dataset before changing the credentials but is there a way of doing it without being the owner? I don't want my "service account" to be the owner of all workspaces....

 

Thanks, 

Mathieu

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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