Skip to Main Content
Cumulocity IoT Feedback Portal
Status Future consideration
Created by Behnaz Najafi
Created on May 24, 2024

Datahub could handle Powerbi embed report with RLS

https://learn.microsoft.com/en-us/power-bi/developer/embedded/cloud-rls

Here explains how we could add RLS in our report, and then what should implement in the backend to generate embed token accordingly for the effective identity (role)

https://learn.microsoft.com/en-us/power-bi/developer/embedded/generate-embed-token#row-level-security


this could be an example code:

app.get('/api/getEmbedToken', async (req, res) => { const reportId = req.query.reportId; const groupId = req.query.groupId; const username = req.query.username; const roles = req.query.roles.split(','); try { const embedToken = await getEmbedToken(reportId, groupId, username, roles); res.json({ embedToken }); } catch (error) { res.status(500).send('Error generating embed token'); } });

  • Attach files
  • Behnaz Najafi
    Reply
    |
    May 24, 2024

    this could be an example code:

    app.get('/api/getEmbedToken', async (req, res) => { const reportId = req.query.reportId; const groupId = req.query.groupId; const username = req.query.username; const roles = req.query.roles.split(','); try { const embedToken = await getEmbedToken(reportId, groupId, username, roles); res.json({ embedToken }); } catch (error) { res.status(500).send('Error generating embed token'); } });