Forum Discussion
dbt job fails with InternalServerError when triggered via REST API using Service Principal
We are unable to trigger a dbt job (DataBuildToolJob) via the Fabric REST API using a Service Principal (SPN). The API accepts the request (HTTP 202) but the job immediately fails with InternalServerError: Job failed to start: unknown error. Manual execution via Fabric Portal UI succeeds without issues. Steps to reproduce: Obtain SPN token via client_credentials grant (scope: https://api.fabric.microsoft.com/.default ) POST https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/items/{item_id}/jobs/Execute/instances — returns HTTP 202 Poll the Location URL — returns status: Failed within <1 second What works: Running the same dbt job manually via Fabric Portal UI — succeeds SPN token acquisition — succeeds API request accepted (HTTP 202) — succeeds Other item types (Notebook, Semantic Model) via same SPN — not yet confirmed for this SPN Expected behavior: dbt job should execute successfully when triggered via REST API using SPN, same as manual UI execution. Question: Is dbt job execution via REST API using Service Principal currently supported? If so, what additional permissions or configuration are required?
please confirm the SPN has at least Contributor access in the workspace, because dbt jobs require Contributor or higher to create/manage, and dbt execution also needs read/write access to the target warehouse and linked assets.
REST API execution for Fabric dbt jobs was only recently announced (the feature was in preview from December 2025 with no API support at all as of January 2026). It's possible SPN execution specifically has a bug or is still rolling out
5 Replies
- nilendraFabric
Super User
please confirm the SPN has at least Contributor access in the workspace, because dbt jobs require Contributor or higher to create/manage, and dbt execution also needs read/write access to the target warehouse and linked assets.
- nilendraFabric
Super User
REST API execution for Fabric dbt jobs was only recently announced (the feature was in preview from December 2025 with no API support at all as of January 2026). It's possible SPN execution specifically has a bug or is still rolling out
- deborshi_nag
Super User
Microsoft docs doesn't explicitly mention SPN support for DBT job runs, it does say the item is in Preview. If you can successfully run it manually from Fabric UI, but not using REST API, it is quite possible that feature has not been rolled out yet!
- v-aatheeque
Community Support
Hi quyendothanh200
Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.