Databricks Cost Lab

BI RLS on Databricks: OAuth vs service principal

Guide · UC / governance wedge · Education only · Not a compliance guarantee

Unity Catalog row-level security applies as whoever Databricks thinks is querying — not whoever clicked the BI chart. OAuth / user-to-machine (U2M) can carry each analyst. A shared PAT, service principal, or machine-to-machine (M2M) connection collapses everyone into one identity. Fabric table mirrors / shortcuts add a third trap: UC filters and masks do not automatically follow Fabric end users.

Pick the identity model first, then pick ABAC / row filter / dynamic view with the UC RLS method picker.

Three paths: OAuth per-user, shared PAT or SP, Fabric mirror needs separate policy
Identity decides whether UC “sees” Ada or a shared bot account.

Decision tree

  1. Does BI authenticate each person into Databricks?
    • Yes (OAuth / U2M) → UC grants, row filters, ABAC, and views evaluate as that user. Prefer this when you need true per-person country/region RLS into the lakehouse.
    • No (PAT / service principal / M2M) → One shared scope. Filters still run, but as the SP. Everyone with that connection sees the SP’s rows (or nothing). Do not call this “per-analyst RLS.”
  2. Is data copied into Fabric / OneLake (mirror or shortcut)?
    • Yes → UC row filters / column masks on Databricks do not apply as the Fabric user. Re-apply policy in OneLake / Power BI, or keep DirectQuery → Databricks SQL so UC still evaluates.
    • No → Stay on live query to Databricks; identity (step 1) dominates.
  3. Then choose the UC method (many tables → ABAC; one simple table → row filter; join mapping → dynamic view). See the picker examples.

Fiction: Ada (HK) vs Ben (SG)

Retail lakehouse table sales.orders with country = HK / SG. Ada should see only HK; Ben only SG. Platform already has a UC row filter (or ABAC tag) keyed on country.

Names and tools are educational. Wire real SSO and grants from your IdP + UC docs.

What this page does not do

Sources (first-hand)

Open UC RLS method picker Governance guides