Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
We are building an ISV application that uses Power BI embedding for rendering of Power BI reports. This application will be distributed to client sites and each will have different database logins (username/password) for all their reports.
We need a way to programmatically (and securely) set these datasource credentials at runtime when a user attempts to run the report. These credentials cannot be appended as parameters to the URL or other insecure methods.
Does anyone have a method for doing this dynamically in C#? Your help is much appreciated.
Ronny
Solved! Go to Solution.
Hi @rshahrabani,
Maybe you can try to parameterize your connection string based on query parameters, then you can dynamically switch Datasource(same data structure) based on posted query parameters and Datasource credentials.
Using the Power BI Service Parameters to change connection strings (To possibly change between Dev
power bi embedded, change connection string for direct query
Power BI Embedded Query Parameters API
In addition, you can also take a look at the following link to switch between different contents:
Tutorial: Embed Power BI content into an application for your customers
Regards,
Xiaoxin Sheng
HI @rshahrabani,
I'd like to suggest you take a look at gateway update data source api and try to use it to set data source credentials.
BTW, I don't think it is possible to update credentials every time when the user accesses. Maybe you can try to set dynamic RLS based on username and configure them in user data.
Row-level security with Power BI Embedded
Regards,
Xiaoxin Sheng
Hi @v-shex-msft,
The Gateways - Update Datasource will modify the credentials on the report residing in the Power BI service, and Row-level security will limit the data to a subset given the username. What we are trying to do is to allow execution of a report's datasource login to be configured for different users.
For example, a client site will have 3 databases (development, QA and production) with identical structures (but different data). The development site will execute the report residing on Power BI service with one set of database credentials (username/password) and the QA site will execute the same report on Power BI service with a different set of credentials. This database login needs to be established at runtime with different credentials for each of these platforms (dev, QA and prod).
Is there any way to do this programmatically within our Power BI embedded app?
Thanks,
Ronny
Hi @rshahrabani,
Maybe you can try to parameterize your connection string based on query parameters, then you can dynamically switch Datasource(same data structure) based on posted query parameters and Datasource credentials.
Using the Power BI Service Parameters to change connection strings (To possibly change between Dev
power bi embedded, change connection string for direct query
Power BI Embedded Query Parameters API
In addition, you can also take a look at the following link to switch between different contents:
Tutorial: Embed Power BI content into an application for your customers
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
2 | |
2 | |
1 | |
1 |