Forum Discussion

cybertron's avatar
cybertron
Regular Visitor
1 year ago
Solved

Embedded Power BI - Dynamic Multiple Workspace Routing

Hi, We have a angular web application embedded with Power BI Reports. We have created workspaces specific to each client (1 power BI workspace per client). An external client user can only access ...
  • Poojara_D12's avatar
    1 year ago

    Hi cybertron 

    What you want to achieve is possible, but it requires shifting away from a static JSON routing file and instead leveraging the Power BI REST APIs and the security model to dynamically determine which workspaces a user has access to. Right now, your Angular app is enforcing access logic, but Power BI itself already tracks user permissions at the workspace level. A cleaner approach would be: when a user logs into your Angular app, use their Azure AD token to call the Power BI REST API (e.g., List Groups endpoint) to fetch the list of workspaces they have access to. From there, you can filter these workspaces to those that match your “client workspaces” convention (like Client X, Y, Z). This eliminates the need for a JSON config because the application dynamically builds the workspace dropdown based on what the API returns. When a user selects a client from the dropdown, your app simply switches the embed configuration to point to the report(s) in the corresponding workspace. External users will only ever see their one workspace because the API will only return that single workspace for their account, while internal users will see multiple options to switch between. Essentially, you’re letting Power BI’s service and APIs handle the access control, and your Angular app just consumes that information to render the correct embed.