Forum Discussion

EdvanceIQ_Chris's avatar
EdvanceIQ_Chris
Regular Visitor
8 months ago
Solved

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

9 Replies

  • 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-venuppu's avatar
    v-venuppu
    Community 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-venuppu's avatar
    v-venuppu
    Community 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_Chris's avatar
      EdvanceIQ_Chris
      Regular 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

      • Mauro89's avatar
        Mauro89
        Super 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-venuppu's avatar
    v-venuppu
    Community 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.