Forum Discussion

cybertron's avatar
cybertron
Regular Visitor
11 months ago
Solved

Embedded Power BI - Multiple Workspace Routing Dynamic

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 ...
  • Anonymous's avatar
    Anonymous
    11 months ago

    Hi cybertron,

    Thanks for reaching out to the Microsoft fabric community forum. Yes, you can remove the static JSON and implement dynamic routing so the app discovers and routes to the correct client workspace at runtime using Power BI APIs and Azure AD authentication. You don’t need the JSON file, replace it with a small dynamic flow that asks Power BI “which workspaces can this signed-in user access?” and then routes/embeds the selected workspace’s report. You can make the app dynamic by using the Power BI REST API + Azure AD login. After the user signs in with MSAL, call GET /groups to list all workspaces they have access to. Now populate your dropdown from that response (external users will only see their client’s workspace, internal users will see multiple). On selection, call GET /groups/{groupId}/reports to get the report(s), then embed with either the user’s AAD token or a generated embed token. Power BI automatically enforces the permissions, so you can safely remove the static routing JSON.

    This way routing is handled dynamically at runtime, and users are only shown the workspaces they’re actually allowed to access.

     

    I would also take a moment to thank vivien57, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

    Best Regards,
    Hammad