Forum Discussion
Fabric API: Unable to create Azure Databricks connection using Service Principal
Hi everyone,
I’m trying to automate the creation of a connection to Azure Databricks using the Fabric API, and I want to use a Service Principal for authentication. I’m having trouble understanding the correct create connection request body. I’m testing the request body using this documentation:
https://learn.microsoft.com/en-us/rest/api/fabric/core/connections/create-connection?tabs=HTTP&tryIt=true&source=docs#code-try-0
I keep getting the following error when trying to create the gateway connection:
{
"requestId": "fe6fee53-7b7c-4206-88ce-d6b287668535",
"errorCode": "CreateGatewayConnectionFailed",
"moreDetails": [
{
"errorCode": "",
"message": "{\"XXXGateway_XX\":{\"error\":{\"code\":\"DMTS_UnsupportedConnectionStringError\",\"pbi.error\":{\"code\":\"DMTS_UnsupportedConnectionStringError\",\"details\":[{\"code\":\"DM_ErrorDetailNameCode_UnderlyingErrorMessage\",\"detail\":{\"type\":1,\"value\":\"Kind: AzureDatabricks is not supported.\"}}],\"exceptionCulprit\":1}}}}"
}
],
"message": "Failed to create gateway connection",
"isRetriable": false
}I already tried using both Databricks and Azure Databricks, but I’m still getting the same error:
“Kind: AzureDatabricks is not supported.”
Has anyone successfully created this type of connection through the Fabric API using a Service Principal?
A working example of the request body would really help. Thanks in advance.
Hi ogureisuo,
There's another endpoint that will list the supported connection types in your environment:
Connections - List Supported Connection Types - REST API (Core) | Microsoft LearnI can see DatabricksMultiCloud, Databricks, ans AzureDatabricksWorkspace.
The API will also tell you what parameters are required.
10 Replies
- tayloramySuper User
Hi ogureisuo,
There's another endpoint that will list the supported connection types in your environment:
Connections - List Supported Connection Types - REST API (Core) | Microsoft LearnI can see DatabricksMultiCloud, Databricks, ans AzureDatabricksWorkspace.
The API will also tell you what parameters are required.
- Lodha_JaydeepSolution Sage
Hi ogureisuo,
Thanks for reaching community, will happy to assist.
The error "Kind: AzureDatabricks is not supported" is the key clue here, and it points to a real current limitation of the Fabric Connections API rather than a request body formatting issue.
Root Cause The Actual Problem
The Fabric Core Connections API (/core/connections/create-connection) does not currently support creating Azure Databricks connections programmatically via the gateway path regardless of whether you use "Databricks" or "AzureDatabricks" as the kind. The DMTS_UnsupportedConnectionStringError with Kind: AzureDatabricks is not supported confirms the gateway engine simply doesn't accept this connection type via the API in the way you're attempting.
What Actually Works The Correct Approach
For the Fabric Azure Databricks connector in pipelines and copy activities, Personal Access Token (PAT) is the supported authentication kind not Service Principal directly. Microsoft Learn
The recommended automation path is:
Step 1 Generate a PAT on behalf of your Service Principal
Your Service Principal can generate its own Databricks PAT programmatically:
# Step 1: Get an Entra ID token for your SP POST https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token Body: client_id, client_secret, scope=2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default # Step 2: Use that token to generate a Databricks PAT POST https://<databricks-workspace-url>/api/2.0/token/create Authorization: Bearer <entra_id_token_from_step1> Body: { "comment": "Fabric automation token", "lifetime_seconds": 7776000 }Step 2 Create the Fabric connection using PAT
Use the correct request body with PAT auth:
{ "connectivityType": "ShareableCloud", "displayName": "AzureDatabricks_Connection", "connectionDetails": { "type": "AzureDatabricks", "parameters": [ { "name": "server", "value": "https://<workspace>.azuredatabricks.net" }, { "name": "httpPath", "value": "/sql/1.0/warehouses/<warehouse_id>" } ] }, "credentialDetails": { "credentialType": "Key", "credentials": { "key": "<databricks_PAT_from_step1>" }, "encryptedConnection": "Encrypted", "encryptionAlgorithm": "None", "privacyLevel": "Organizational", "skipTestConnection": false } }Important Caveats
- For copy activity specifically, Personal Access Token is the only available authentication kind Service Principal is not directly supported as an auth type in the Fabric connector for Databricks. Microsoft Learn
- It is not currently possible to use Microsoft Fabric Workspace Identities to access the Databricks SQL API a service principal granted access to Unity Catalog with a PAT generated on its behalf is the current recommended pattern. Medium
- If you need Service Principal OAuth (not PAT), that path currently only works for Dataflow Gen2 connections, not pipeline copy activities
Summary
What you tried
Why it fails
SP directly via gateway connection API
Not supported — AzureDatabricks kind unsupported via this path
Solution
Generate a PAT for your SP, then create a Key-based connection
Hope this unblocks you! Mark as Accepted Solution if it helps
- ogureisuoHelper I
Hi, thank you for your reply. We prefer to use a service principal instead of PAT authentication. Creating the connection via the gateway UI works as expected using the service principal, but when we attempt the same via this endpoint, it fails. Could you help me understand what might be missing or misconfigured?
- Lodha_JaydeepSolution Sage
Hi Anonymous,
Just wanted to add a transparency note to my earlier response. I used AI assistance to help research and draft this reply. I reviewed the technical content before posting to ensure accuracy, but wanted to be upfront about that as per the community guidelines.
Apologies for not disclosing this initially.
- tayloramySuper User
Hi Lodha_Jaydeep,
Where did you find documentation about the AzureDatabricks connection type?
When I run the API that lists all connection types available, I only see DatabricksMultiCloud, Databricks, ans AzureDatabricksWorkspace.
- v-ssriganeshCommunity Support
Hello ogureisuo,
Hope everything’s going great with you. Just checking, the issue been resolved or are you still running into problems? Sharing an update can really help others facing the same thing.
Thank you.
- v-ssriganeshCommunity Support
Hello ogureisuo,
Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.
Thank you for being part of the Microsoft Fabric Community.