Showing results for 
Search instead for 
Did you mean: 
Helper V
Helper V

Power BI Embedded: Multitenancy

Hi All,


I am a first-time user of PowerBI Embedded. I am using the Embed sample code as a solution for our organization's report.  I was able to see the report successfully embedded in the application using the sample templates from Microsoft. 


Current Process to create new dataset when new tenant is onboaring:

Currently when new tenant is onboarding, I need to create the datasets manually using the updated reports(can take as template to create new datasets), in which I need to change the datasource from Power Query editor and need to published the dataset/report in Power BI services.


Automatic Process:

Need to automatically create the datasets using the template dataset/report and publish in workspace by change the datasource.


Datasource used for dashboard is Azure Table, seperate location per tenant.


Please help me to solve this issue or please send me some documentation or code to solve the issue.

Community Support
Community Support

Hi @atul-patil ,


You can try to create a template app: 


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


Hi @V-lianl-msft ,


This is not matching to my requirements.


Thanks for the reply

Hi @atul-patil ,

I do this using an empty (no data included) model file (.pbix) and Parameters to connect to the datasources. This allows me to store the empty model file in source control, and when deploying to the service, I copy the file from the source control location to blob storage, then for each new tenant I create a new workspace and copy the empty pbix file to the workspace, set the Parameters to the appropirate data source using the Power BI API, then trigger a refresh on the empty dataset. The refresh loads the data into the model, and you're done. 

Of course you need to change your model so that it uses the Parameters to locate the data sources. I'm using an Azure SQL database for each tenant, so I have Parameters for the DB server name, the database name, plus any other specific info needed by the system (like a Client ID, but that is specific to my implementation).

I don't know how many ways you can create an empty model, but I created the full model with data, then exported it to a .pbit file, then opened the .pbit file and save it back to a .pbix file without doing a refresh. If you have Parameters, they will be empty when you open the .pbit file, and you must have something in each one. So, I save the letter "a" in each one. It doesn't matter what you save at this point because you will overwrite anything in the Parameters after you upload the pbix file to the workspace. After you have something in each Parameter, you can save, and it will ask you to Apply Changes, but there is a nice little button that says, "Apply later" and that allows you so save the file without any data. Having no data in the source control file helps make sure no unintended data gets out to a client, and the file size is nice and small as it travels through your build pipeline. No sense clogging the pipeline with a large file full of bogus data.

Note, the Power BI Service does not support template files (.pbit). The file format is very different from a pbix file. That's the reason I go round-and-round with the pbix file to create the file with the model structure, but no data. (aka my own template)

Since you will be using the Power BI API to create the workspace and set the Parameters, I highly recommend you use the following try/catch pattern to understand any error codes coming back from the service. I banged my head on multiple walls trying to understand the error "400 Bad Request." Great. Really discriptive! But then I realized the nugget of gold was a level down. e.g. Response.Content.

This is C#. Hope it helps.


Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Kudoed Authors