Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I am using App-Owns-Data embed scenario in a multi-tenant environment. Some of my paginated reports need connection to Fabric Lakehouse (data is from MongoDB so needs to be preprocessed and stored in a Lakehouse).
When assigning report to a tenant (copying the report from master workspace) I need to patch credentials. I am using PowerBI API 4.16. - Gateways.UpdateDataSourcesAsync method. I am trying to patch credentials of a service principal. I've tried to create credentials using basic authentication as well as OAuth2. I am unable to patch Service Principal credentials (receiving Unauthorized response from the API. The same happen when I try Service Principal authentication over Azure SQL database.
Did anyone have similar issue? Any suggestions?
Thanks and regards,
Nikola
Hi, @jeremic_nikola
According to the Microsoft documentation, you need to follow these steps:
You can also use PowerShell scripts to patch the credentials of the dataset, as shown in this example.
How to update Azure SQL datasource credentials of PowerBI dataset programmatically? - Stack Overflow
For reference:
Enable service principal authentication for read-only admin APIs - Power BI | Microsoft Learn
Configure credentials programmatically for Power BI embedded analytics - Power BI | Microsoft Learn
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thanks, this is much appreciated. However, is there an example of creating credentials with service principal authentication?
All other credential types are working, but the one with Service principal is not documented. Should I use Basic? OAuth2? And also, I am using all cloud data sources.
Should i still be following the article:
Configure credentials programmatically for Power BI embedded analytics - Power BI | Microsoft Learn
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 56 | |
| 56 | |
| 35 | |
| 18 | |
| 14 |