Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

330
Vistas
Embed PowerBI With RLS

I'm trying to embed a powerbi report in a .NET Core Project with RLS(row level security)

The issue is I'm unable to add the reference to the embedToken on the front end.

Here is the front end code:

<script type="text/javascript">

    // This code is for sample purposes only.

    // Configure IFrame for the Report after you have an Access Token.
    window.onload = function () {
        var reportData = @Html.Raw(Json.Serialize(Model));

        var accessToken = reportData.AccessToken;
        var embedUrl = reportData.EmbedUrl;
        var reportId = reportData.ReportId;
    

        //show panel for admins
        if (userIsAdmin == "true") {
            filterPaneEnabled = true;
        }
        else {
            filterPaneEnabled = true;
        }

        var config = {
            type: 'report',
            accessToken: accessToken,
            embedUrl: embedUrl,
            tokenType: models.TokenType.Embed,
            id: reportId,
       
            settings: {
                filterPaneEnabled: filterPaneEnabled,
                navContentPaneEnabled: true
            }
        };

        // Grab the reference to the div HTML element that will host the report.
        var reportContainer = document.getElementById('reportContainer');
        // Embed the report and display it within the div container.
        var report = powerbi.embed(reportContainer, config);
    };
</script>

Here is the backend token generation by providing effective identity/role for rls:

  var rls = new EffectiveIdentity(username: "someuser", new List<string> { "someid" });

                var rolesList = new List<string>();
                rolesList.Add("DYNAMIC_RLS");
                rls.Roles = rolesList;

                var embedToken = client.Reports.GenerateTokenInGroup(groupId, reportId,
                    new GenerateTokenRequest(accessLevel: "View", datasetId: "someid", rls));



                EmbedToken token = await GetEmbedToken(client, reportId, groupId, accessToken);
                

                Report powerBIReport;
                powerBIReport = await GetPowerBIReport(client, reportId, groupId);
                if (powerBIReport != null)
                {
                    model.ReportId = reportId;
                    model.ReportName = report.Name;
                    model.EmbedToken = token;
                    model.AccessToken = accessToken;
                    model.EmbedUrl = powerBIReport.EmbedUrl;
                    model.UserIsAdmin = "false";
                }

Here are the errors I'm getting: I noticed if I remove " tokenType: models.TokenType.Embed" from the front end config the report renders but no rls is shown.

Any tips? I have verified the embed token is generated correctly as I connected via powerbi sandbox environment!

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda