0

I’m working on embedding a Power BI report that uses a DirectQuery dataset, and I want to implement Row-Level Security (RLS) through my .NET Core backend.

Setup Details: Report Type: Power BI PBIX report (not Paginated) Dataset Mode: DirectQuery Dataset Columns: User_Id Business_Key Period_Key

Goal: Pass User_Id as username Pass Business_Key and Period_Key as customData Use these values in Power BI RLS filter logic

Current Implementation (.NET Core):

var effectiveIdentity = new EffectiveIdentity(
    username: userId,
    datasets: new List<string> { datasetId }
)
{
    CustomData = $"{businessKey}|{periodKey}"
};

var tokenRequest = new GenerateTokenRequestV2
{
    Reports = new List<GenerateTokenRequestV2Report> { new(reportId) },
    Datasets = new List<GenerateTokenRequestV2Dataset> { new(datasetId) },
    TargetWorkspaces = new List<GenerateTokenRequestV2TargetWorkspace> { new(workspaceId) },
    Identities = new List<EffectiveIdentity> { effectiveIdentity }
};

var embedToken = await client.EmbedToken.GenerateTokenAsync(tokenRequest);

Environment Details: Power BI API: Microsoft.PowerBI.Api v4.22 Backend: .NET Core 6 Embedding: App-Owns-Data scenario Workspace: Premium capacity

Is RLS supported for DirectQuery datasets when embedding reports using EffectiveIdentity? Do we need to configure RLS in the underlying database (since it’s DirectQuery), or can it be managed in Power BI like Import mode? Are there known limitations or workarounds for passing username and customData with DirectQuery models?

2
  • I would like to know if there are any workaround solution for this scenario. Since we have a large set of data in millions, we would like to go with DQ route. Commented Oct 8 at 19:21
  • RLS is a feature of the storage-engine or RDBMS - and not the reporting engine, so you cannot "implement RLS" in a .NET back-end because that isn't the storage-engine. However, it sounds like you should be looking to implement general data access-controls in your application-tier code (so not RLS specifically). We cannot currently help you further because you haven't posted any details of the underlying data-source that you're attempting to connect to (MSSQL? Postgres? Memcached?) so we can't really help you yet. Commented yesterday

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.