Forum Discussion

ShijuKuchelan's avatar
ShijuKuchelan
Frequent Visitor
9 months ago
Solved

How to dynamically bind datasets for multi-tenancy in Microsoft Fabric?

Hi Community,
I'm working on a multi-tenant reporting architecture using Microsoft Fabric and Power BI embedded. Here's the setup:
Master Workspace:
Group ID: ce3d45f0-57e0-497b-xxxx-xxxx
Dataset ID: ad4fa88c-22f0-484d-xxxx-xxxx
Report ID: 367535ef-4318-4a49-xxxx-xxxx
 
I used the following Fabric APIs to extract the semantic model definition from the master workspace and dynamically modify the schema (e.g., tenant-specific schema name) before creating a new semantic model in the target tenant workspace:
Tenant1 Workspace:
Group ID: 339f6fed-edf3-4874-xxxx-xxxx
Dataset ID: be1863ba-f343-4c3a-xxxx-xxxx
Embedded Token Generation: 
  Here’s the curl command I used to generate the embedded token:
--header 'Authorization: Bearer  authToken ' \
--header 'Content-Type: application/json' \
--data '{
        "reports": [
          { "id": "367535ef-4318-4a49-xxxx-xxxx", "groupId": "ce3d45f0-57e0-497b-xxxx-xxxx" }
        ],
        "datasets": [
          { "id": "661fb1b8-3910-4a0e-xxxx-xxxx",
          "xmlaPermissions": "ReadOnly" }
        ],
        "targetWorkspaces": [
          { "id": "339f6fed-edf3-4874-xxxx-xxx" }
        ]
      }'      
 Report Load Configuration:        
   Config Object: {
  "type": "report",
  "tokenType": 1,
  "accessToken": "embedded token",
  "datasetBinding": {
    "datasetId": "be1863ba-f343-4c3a-xxxx-xxxx"
  }
}
 
I'm getting the following error when trying to load the report:
Underlying ErrorPowerBI service client received error HTTP response. HttpStatus: 500. PowerBIErrorCode: Premium_ASWL_Error
Power BI Premium Backend ErrorAn error has occurred while getting the identity from credential, error: AAD token is null or empty.
 
Any feedback or suggestions are welcome and appreciated 

6 Replies