Forum Discussion
Fabric Pipeline, T-SQL Notebook and Service principal
- 4 months ago
Hi usernamehere1 ,
Thank you for clarifying. The error indicates that T SQL notebook execution is still using an OBO based authentication flow for some internal Fabric or Power BI API calls. Because Service Principals aren't supported in OBO flows, the execution fails when a Service Principal is the last modifier. To work around this, you could convert the notebook to PySpark and run your queries with spark.sql(), which should bypass this issue.
I hope this clarifies the situation. If I’ve misunderstood any part of your situation, please let us know.
Hello usernamehere1
Although Notebook activities in Fabric pipelines are intended to run under the identity defined by the Connection (Service Principal or Workspace Identity), this capability has not been fully rolled out or consistently applied across all notebook workloads.
In practice:
- T‑SQL notebooks (Warehouse / SQL DW workload) still rely on delegated On‑Behalf‑Of (OBO) authentication for certain internal control‑plane calls (for example, Power BI/Fabric platform operations against analysis.windows.net/powerbi/api).
- When the effective identity is a Service Principal (e.g. because Git sync updates the item and sets the SPN as last modifier), these OBO calls fail because service principals are not supported for Power BI OBO flows.
- As a result, even though a Connection is configured, the T‑SQL notebook execution path may still fall back to delegated/last‑modifier context, leading to authentication errors.
- PySpark notebooks are not affected because they use a different execution path and do not hit the same Warehouse/OBO dependency.
This is a known rollout gap / limitation rather than a misconfiguration.
This approach:
- Uses explicit SQL authentication
- Avoids the notebook OBO execution path entirely
- Is stable and production‑safe for CI/CD scenarios
Thank you for your answer. T-SQL notebook is very large and at this point I wouldn't move it to Stored procedures unless I really have to. If I change notebook to PySpark notebook and run querys as spark.sql would it be working work-a-round for OBO path?