Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
I am working in a multi-tenancy setup where each tenant has their own database. I am uploading a pbix file to a workspace and then trying to update the datasource to the correct connection and refresh the data using the API.
I can update the datasource fine by calling client.Datasets.UpdateDatasourcesAsync on the PowerBIClient. I pass in the UpdateDataSourcesRequest which contains a DatasourceConnectionDetails object, inside which is the server and database details. This succeeds however when I then call client.Datasets.RefreshDatasetAsync to refresh the data, I get an error.
It looks like scheduled refresh failed because at least one data source is missing credentials.
To start the refresh again, go to this dataset's settings page and enter credentials for all data sources.
The issue appears to be the dataset is "owned" by the service principal. If I login and take over it, then refresh, it works. My aim is to be able to upload these pbix files to tenants and update to the correct datasource using the principal. Is this possible or will I have to use a master user for this instead?
Thanks
Solved! Go to Solution.
Hi @JAnder ,
It looks like scheduled refresh failed because at least one data source is missing credentials.
To start the refresh again, go to this dataset's settings page and enter credentials for all data sources.
According to your statement, please make sure you have configured credentials of your data source correctly in Power BI Service. If your data source need gateway to refresh, please add the credential to data source in gateway.
Add or remove a gateway data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @vamshikrishna20 ,
Using "Service Principal to Authenticate Data Source Credentials" , is still not supported. Power BI is unable to get RefreshToken for Service Principal after initial Authentication during Data Source Credentials update. As a work-around, I have implemented following
Hope this will help you, I think with MS Fabric there are changes expected in the REST API and AUTH process
Thanks
@vamshikrishna20 - Yes, this will work for Direct Query as well , I have used this method for Direct Query connection to Azure Databricks Unity Catallog tables, Azure SQL Server Tables , ADLS Gen2 files
@bhushant , sorry if my questions seems lame, just wanted to recheck- if you have implemented this using spn or master account.
if SPN, my assumtpion is this will work through access token which gonna expire in one hour. so after one hour will the report refresh fail
@vamshikrishna20 -I have implemented this using Master-Account [AzureAD user],where the master account user will have permissions on to query data on data sources.
Thanks
@bhushant , do we have any documentation from microsoft or what was the turning point for you to switch from spn authentication to master account authentication.
Also, to run the CD pipeline with Master account, do we have to set any permission in Azure Portal?
Hi @JAnder and @v-rzhou-msft -
I am trying to solve similar problem. please let me know if you have found a workaround or solution
Please see my use-case below
Use Service Principal to connect Data Source [ Azure SQL DB , Azure Databricks Delta Lake]
Please can you let me know
Appreciate your help, Many Thanks
Thanks for responding. This is all being done via the API so logging in and doing it using the Power BI portal is not really an option. The data source already exists and is in use elsewhere though, so I am confident the credentials are OK.
The problem seems to be because I am uploading a pbix and switching the datasource connection string using the API, which uses the Service Principal. The service principal takes ownership and then cannot refresh. If I was to login and "take over" the dataset with an admin account it would refresh ok.
I am looking for ideas how to handle that with the API. The answer may just be I cant use the principal and need a master user?
Hi @JAnder ,
It looks like scheduled refresh failed because at least one data source is missing credentials.
To start the refresh again, go to this dataset's settings page and enter credentials for all data sources.
According to your statement, please make sure you have configured credentials of your data source correctly in Power BI Service. If your data source need gateway to refresh, please add the credential to data source in gateway.
Add or remove a gateway data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
User | Count |
---|---|
9 | |
2 | |
2 | |
2 | |
2 |