Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I am new to setting up API's in PowerBi to get data, I have been successful in getting something configured where I can utilise our API endpoint to get an access token and then pass this access token to, two API requests that get the data I need and have been able to build a basic dashboard from the returned data but I need to make this dynamic. Now this is hardcoded to a service account I set up that has full access rights to the data and system.
I work for a cloud solution, and we have our own API Endpoints (Swagger) with pass through permissions i.e., what data you have access to, what navigation you have access to etc. User logs in, we get their access token, this is then passed to other requests for getting data from the backend.
I want to use our API to leverage the data in the system through PowerBi but I want to be able to pass through the users credentials to the API's in PowerBi so they are dynamic i.e., I have a user who has access to table 1 and a manager who has access to all data, when user logs into our system and goes to PowerBi dashboard (embedded) it will only show the data they are allowed through their permissions in our API but when the manager logs in they will see all data, the report will be the same for both users but our API will control what they see in it.
I have watched quite a few YouTube video's and read resources but cannot seem to find anything definitive, not sure if its even possible but would be good to know. It maybe I have to do something through https://playground.powerbi.com/ to build this out and then migrate to our infrastructure but just taking a stab.
Also as a follow up question, when having a PowerBi hosted within our system, can users refresh on demand? as I want to build this using API's the data is effectively live based on the user refreshing from the hosted dashboard.
If the above is achievable it will allow us to leverage generic PowerBi dashboards as part of tech for clients.
Many thanks for reading.
Gareth
Hi @Garethmajones ,
Accoriding to your statement, I think you are get data from API and now you want to restrict data baesd on the users who login in .
Here I suggest you to refer to this offical blog to learn more details about Row-Level-Security in Power BI.
Row-level security (RLS) with Power BI can be used to restrict data access for given users. Filters restrict data access at the row level, and you can define filters within roles. In the Power BI service, members of a workspace have access to datasets in the workspace. RLS doesn't restrict this data access.
It is configured in Power BI Desktop and will work in Power BI Service.
If you want to use RLS in Power BI Embedded Report, please refer to this offical blog.
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 Rico, thank you for your response.
I may have not made myself clear in my initial posting, apologies but what I want to try and achieve is this.
In my test report I have built, I have the below function. I can add in the URL, Username and Password and this will then give me a token to that application. This token then drives two API calls I have that gets data from the database.
I want to be able to make this dynamic so that when a user logs into PowerBi dashboard that is embedded this function will get their appropriate token that already has permissions attached to it and then will drive the data they see in the PowerBi dashboard, so not sure if this is achievable.
Equally I am struggling to see how to do on demand refresh from an embedded PowerBi dashboard so the data can be retrieved through the API's.
Function to get access token
Data Set