Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
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
Here is the code which you can use as a starting point.
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
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |