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
dpiret
Helper I
Helper I

Create or clone datasets programmatically via API

Hi there,

I need to either create or clone dataSets from one workspace to another via API. The goal is creating a workspace per tenant, each with their own dataset and reports.

Each dataset have their Gateway data source (Direct Query to on-premises SQL Server)

The documentation show no options to create or clone a dataset (unless they are PUSH datasets, which are streaming-only).

Here are the options I beleive I can try, but I'd appreciate some guidance

  • Option 1. Clone the reports, which bring along the dataset. Then change the dataset's datasource. This is unlikely to work since the dataset will be shared and if I change the data source, it will do so for the original workspace.
  • Option 2: Instead of having a "golden" workspace, have a "golden" local PIBX, upload it, then change the dataset's data source. Unsure whether this is even feasible,.
  • Option 3: try creating a push dataset, then change its properties to make it non-straming

In a video (https://youtu.be/G1vVFoKKrwE?t=1438) minute 24, you can see a C# wrapper funtion CreateDataset(targetWorkspaceId, datasetConfigPath). I would assume that if it can be done with the SDK, it can be done with the API directly (I'm not using C#)

 

Any ideas on the above or alternatives that you can think of?

Thanks!

3 REPLIES 3
lbendlin
Super User
Super User

Option 2 is what I have seen people use.  Should be possible with the standard REST API calls.  There are some small issues with taking over datasets but these can be worked around.

Thanks @lbendlin I can confirm that's a working option (uploading the PBIX)

 

If anyone has managed to clone a dataset using the API, please share! 🙂

 

thanks

Anonymous
Not applicable

Hi @dpiret - I would be really keen to see/understand your solution. 
I am using a python script as my datasource. It pulls the data from a file S3 Bucket. 
I was wondering If I can edit the python on the dataset, to pull from a different S3 object.

 

Jeff 

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