Forum Discussion

maxkent's avatar
maxkent
Frequent Visitor
1 year ago
Solved

Semantic model movement and data source

We have the following scenario:

 

1. Semantic Model A 

2. Workspace 1 (Tenant 1)

3. Workspace 2 (Tenant 2)

 

We want to move the semantic model from workspace 1 to workspace 2. As you can see the workspaces are in different tenant (so the option of using Fabric deployment pipelines is excluded).

 

What we tried is to use Git integration. It works as we change the below connection string in the model.bim file, however when we try to add/remove tables to the semantic model we receive a generic error. 

The error is gone if we remove and readd all the tables, but that means all the relationships are gone.

Isn't there a way to avoid this and make the semantic model refresh all the ids under the hood?

  • Anonymous's avatar
    Anonymous
    1 year ago

    Just re-deploy the original pbix file to the other workspace.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Your solution is great 3CloudThomas 

    Hi, maxkent 

    As super user said, you can re-upload your reports to your workspace in different tenants. First of all, you need to have a user with permissions above the contributor role in the different tenant workspace, this can be done by inviting your account as an external user in the different tenant and then granting this permission, you can refer to the following documentation:

    Distribute content to external guest users with Microsoft Entra B2B - Power BI | Microsoft Learn

    Once you have the permissions, you can deploy your reports to your target workspace via Powershell, here is an example:
    First, we need to install the Power shell module:

    Install-Module -Name MicrosoftPowerBIMgmt

    Use the following command to deploy the master semantic model to multiple workspaces:

    Connect-PowerBIServiceAccount
    $Path = "C:\Users\xxxx\Desktop\Protest.pbix"
    $targetWorkspaceIds = ("xxxx-xxx-xxx-xxx","xxxx-xxx-xxx-xxx","xxxx-xxx-xxx-xxx")
    foreach($targetWorkspaceIds in $targetWorkspaceIds){
         New-PowerBIReport -Path $Path -Name "Testaaa" -WorkspaceId $targetWorkspaceIds
    } 

    The result returned in PowerShell is as follows:

    Check if they are successfully deployed in Power BI:

    You can learn about these PowerShell commands from the following link:

    https://learn.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.reports/new-powerbireport?view=powerbi-ps

    https://github.com/Microsoft/powerbi-powershell

    You can then update your gateway connection for this semantic model using this API below:

    Datasets - Update Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn

    With the above scenario, you need to have an in-depth knowledge of PowerShell, RestAPI and then practice it.

     

     

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Just re-deploy the original pbix file to the other workspace.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Your solution is great 3CloudThomas 

    Hi, maxkent 

    As super user said, you can re-upload your reports to your workspace in different tenants. First of all, you need to have a user with permissions above the contributor role in the different tenant workspace, this can be done by inviting your account as an external user in the different tenant and then granting this permission, you can refer to the following documentation:

    Distribute content to external guest users with Microsoft Entra B2B - Power BI | Microsoft Learn

    Once you have the permissions, you can deploy your reports to your target workspace via Powershell, here is an example:
    First, we need to install the Power shell module:

    Install-Module -Name MicrosoftPowerBIMgmt

    Use the following command to deploy the master semantic model to multiple workspaces:

    Connect-PowerBIServiceAccount
    $Path = "C:\Users\xxxx\Desktop\Protest.pbix"
    $targetWorkspaceIds = ("xxxx-xxx-xxx-xxx","xxxx-xxx-xxx-xxx","xxxx-xxx-xxx-xxx")
    foreach($targetWorkspaceIds in $targetWorkspaceIds){
         New-PowerBIReport -Path $Path -Name "Testaaa" -WorkspaceId $targetWorkspaceIds
    } 

    The result returned in PowerShell is as follows:

    Check if they are successfully deployed in Power BI:

    You can learn about these PowerShell commands from the following link:

    https://learn.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.reports/new-powerbireport?view=powerbi-ps

    https://github.com/Microsoft/powerbi-powershell

    You can then update your gateway connection for this semantic model using this API below:

    Datasets - Update Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn

    With the above scenario, you need to have an in-depth knowledge of PowerShell, RestAPI and then practice it.

     

     

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.