Forum Discussion
Migrating process to Git Integration with Multi Tenancy
- 5 months ago
Hi JAnder,
This is a suggested architectural approach, and since there is no official documentation for this exact pattern, we couldn’t fully reproduce your scenario due to licensing, access limitaions in our environment.
If the required permissions and licensing are in place, could you please try this from your end and let us know the result? I can also share some internal reference documents privately if helpful.
Suggested approach:
Firstly, Create parameters for tenant-specific valuesIn Power Query Editor, go to Home → Manage parameters → New parameter and create the following parameters:
These values act as placeholders and can later be updated per customer (for example, through REST APIs after the report is published). Replace hardcoded connection values with parameters.
In Power Query Editor, select your main query and open Advanced Editor. Update the
parameterized query:
Source = Sql.Database(ServerName, DatabaseName)
This is the key change. once parameters are used, the dataset is no longer tied to a specific server or database. Once done push this template report to GIT and sync with customer workspaces.
For tenant-specific configuration, the workspace is updated to point to the customer’s data by modifying dataset parameters rather than changing the connection string directly: The configuration is performed using the Power BI REST APIs, where parameters such as server name and database name are updated at the dataset (semantic model) level
(Workspace → Semantic Model (Dataset) → Settings → Parameters).Once the parameters are updated, the dataset is bound to the workspace identity using the same REST API–based credential and identity binding process. This ensures that authentication is handled through the workspace’s managed identity or configured credentials, without embedding sensitive connection details in the model.
After the parameters and credentials are successfully applied, a dataset refresh is triggered via the Power BI REST API. Upon completion of the refresh, the semantic model connects to the updated data source and loads Customer’s data correctly.
Required permissions:
Workspace access: The identity performing the action must be added to the target workspace as Member or Admin. Viewer access is not sufficient.
REST API execution: Updating dataset parameters, binding gateways, and triggering refresh must be done via Power BI REST APIs. UI access alone cannot perform these actions.
Service Principal: generally, automation and production scenarios, use an Azure AD App (Service Principal) instead of a user account.
API permissions (Application level)
The app must have:- Dataset.ReadWrite.All
- Workspace.ReadWrite.All
Admin consent is required.
Tenant setting: In the Power BI Admin Portal, “Allow service principals to use Power BI APIs” must be enabled.
Thanks,
Prashanth
Hi JAnder,
This is a suggested architectural approach, and since there is no official documentation for this exact pattern, we couldn’t fully reproduce your scenario due to licensing, access limitaions in our environment.
If the required permissions and licensing are in place, could you please try this from your end and let us know the result? I can also share some internal reference documents privately if helpful.
Suggested approach:
Firstly, Create parameters for tenant-specific values
In Power Query Editor, go to Home → Manage parameters → New parameter and create the following parameters:
These values act as placeholders and can later be updated per customer (for example, through REST APIs after the report is published). Replace hardcoded connection values with parameters.
In Power Query Editor, select your main query and open Advanced Editor. Update the
parameterized query:
Source = Sql.Database(ServerName, DatabaseName)
This is the key change. once parameters are used, the dataset is no longer tied to a specific server or database. Once done push this template report to GIT and sync with customer workspaces.
For tenant-specific configuration, the workspace is updated to point to the customer’s data by modifying dataset parameters rather than changing the connection string directly: The configuration is performed using the Power BI REST APIs, where parameters such as server name and database name are updated at the dataset (semantic model) level
(Workspace → Semantic Model (Dataset) → Settings → Parameters).
Once the parameters are updated, the dataset is bound to the workspace identity using the same REST API–based credential and identity binding process. This ensures that authentication is handled through the workspace’s managed identity or configured credentials, without embedding sensitive connection details in the model.
After the parameters and credentials are successfully applied, a dataset refresh is triggered via the Power BI REST API. Upon completion of the refresh, the semantic model connects to the updated data source and loads Customer’s data correctly.
Required permissions:
Workspace access: The identity performing the action must be added to the target workspace as Member or Admin. Viewer access is not sufficient.
REST API execution: Updating dataset parameters, binding gateways, and triggering refresh must be done via Power BI REST APIs. UI access alone cannot perform these actions.
Service Principal: generally, automation and production scenarios, use an Azure AD App (Service Principal) instead of a user account.
API permissions (Application level)
The app must have:
- Dataset.ReadWrite.All
- Workspace.ReadWrite.All
Admin consent is required.
Tenant setting: In the Power BI Admin Portal, “Allow service principals to use Power BI APIs” must be enabled.
Thanks,
Prashanth
Apologies for not getting back sooner, I have been on another project and didnt see this reply.
I think the problem with adding parameters to reports, is purely that we had an awful of lot of reports in pbix format. I did some testing and it looks like many of the REST API endpoints do still work, of course I cannot deploy with import anymore but I am wondering now if rewriting our custom tooling to wrap Git might be a better solution
Rather than using the import API it can run some git commands to move the reports into the relevant repo folders for deployment. Then we can trigger the workspace sync, update connection strings etc using the REST API as before.
I dont know if what we are doing is unique, it does seem to go against the way all the documentation suggests but we are multi-tenanted and have so many reports per tenant that manual editing is not going to be possible.
Hopefully once we have these in Git and are using the new formats, we could use AI for future mass editing if needed.
I appreciate your reply, my apologies it took me so long to acknowledge it.