Forum Discussion
Clone an import semantic model with all data and rename clone.
Ideally I would like to clone a semantic model with all its data and give it a new name and put on a folder, all from within a Notebook. Unfortunatly, it seams that there is a limitation that you cannot write back to fabric from within the notebook. Is there an easy way that I can automate the cloning and renaming of semantic models with the data so that I can keep a historical version of the data in these models ? ie automatically to run once a month? Anyone have anything that can do this from a notebook, or pipeline?
Thanks
For the deployment pipeline approach you can find a step by step guide here:
Get started using deployment pipelines, the Fabric Application lifecycle management (ALM) tool - Microsoft Fabric | Microsoft Learn.If you also want to automate this, check out the possibilities of Fabric CI/CD (fabric-cicd). But for this I dont know any step by step guide.
9 Replies
- Kedar_PandeSuper User
Pipeline activities:
1. Get dataset metadata (REST API)
2. Export data to Lakehouse/Files
3. Create new semantic model
4. Import data back
5. Rename & publishIf this answer helped, please click Kudos or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande - Mauro89Super User
Hi EdvanceIQ_Chris,
another option if you would like to have the semantic model in another workspace is to make use of Fabric Deployment Pipelines and deploy the semantic model to another workspace.
Best regards!
- v-venuppuCommunity Support
Hi EdvanceIQ_Chris ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you Mauro89 Kedar_Pande for the prompt response.
You can’t clone or rename an Import semantic model directly from a Fabric notebook, but you can automate it using the Fabric/Power BI REST APIs. The supported approach is to call the Clone Dataset API, which creates a full copy of the semantic model including data and lets you give it a new name and location. You can trigger this API call from a Notebook, Pipeline, or any scheduled automation, allowing you to generate monthly historical versions of the model. After cloning, you can also use the REST API to move the new model into a folder. This is the only fully supported way to automate semantic-model versioning in Fabric today.
- v-venuppuCommunity Support
Hi EdvanceIQ_Chris ,
I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.
Thank you.
- EdvanceIQ_ChrisRegular Visitor
I have reviewed but none have actually give me any way forward. I really am after code examples or components that show how to do this. I have tried many attempts but have been blocked by read only functionality when trying to clone the import model with data. And I do not want to have to export and reimport. There must be a way to clone an import model with data and save it to a different name easily, but need examples. Thanks
- Mauro89Super User
If you are after code, then of course my and the answer from Kedar_Pande do not fit as they are low-code/no-code 😂
Why are you sticking with code?
Another important thing for the approach is to know if you cloned semantic model shall run indepentend after the "clone" process or still have a connection to the original?
- v-venuppuCommunity Support
Hi EdvanceIQ_Chris ,
May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.
Thank you.