Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rafaesanto83
Frequent Visitor

Error to create a Databricks datasource using Power BI Rest API

I successfuly used the "Gateways - Create Datasource" (https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource) method from Power BI Rest API to create a SQL datasource, but I´m stuck when I try to create a Databricks datasource.

I saw that there is no Databricks datasource kind, but it could be possible to use the kind "Extension". So a try this code:

 

OBS: I generated the credential part using the data gateway publick key and a Databricks key.

 

{
    "datasourceName": "Databricks AIDA Teste",
    "datasourceType":"Extension",
         "connectionDetails":{
            "path":"{\"host\":\"adb-xxx.azuredatabricks.net\",\"httpPath\":\"\\/sql\\/1.0\\/warehouses\\/xxx\"}",
            "kind":"Databricks"
         },
    "credentialDetails": {
        "credentialType": "Key",
        "credentials": "xxx",
        "privacyLevel": "Organizational"
    }
}

 

And get this error:

 

{
    "error": {
        "code": "BadRequest",
        "message": "Bad Request",
        "details": [
            {
                "message": "Unexpected character encountered while parsing value: {. Path 'connectionDetails', line 4, position 30.",
                "target": "datasourceToGatewayRequest.connectionDetails"
            },
            {
                "message": "'datasourceToGatewayRequest' is a required parameter",
                "target": "datasourceToGatewayRequest"
            }
        ]
    }
}

 

What am I missing, or doing wrong?

1 ACCEPTED SOLUTION

Hello, @Anonymous!

 

{
    "dataSourceType": "Extension",
    "connectionDetails": "{\"extensionDataSourceKind\":\"Databricks\",\"extensionDataSourcePath\":\"{\\\"host\\\":\\\"adbXXX.2.azuredatabricks.net\\\",\\\"httpPath\\\":\\\"\\\\/sql\\\\/1.0\\\\/warehouses\\\\/YYYYYY\\\"}\"}",
    "datasourceName": "Azure Databricks AIDA API REST v4 (D9T5) TESTE",
    "credentialDetails": {
        "credentialType": "Key",
"credentials": "XX=",
        "encryptedConnection": "Encrypted",
        "encryptionAlgorithm": "RSA-OAEP",
        "privacyLevel": "Organizational"
    }
}

 The issue are related with some missing slashes. This version works well!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@rafaesanto83  Did you find a solution to this? I am trying to pull data from PowerBI (user input from sliders on a visual) to Databricks. I thought your solution might be one peice of the puzzle. Thanks!

Hello, @Anonymous!

 

{
    "dataSourceType": "Extension",
    "connectionDetails": "{\"extensionDataSourceKind\":\"Databricks\",\"extensionDataSourcePath\":\"{\\\"host\\\":\\\"adbXXX.2.azuredatabricks.net\\\",\\\"httpPath\\\":\\\"\\\\/sql\\\\/1.0\\\\/warehouses\\\\/YYYYYY\\\"}\"}",
    "datasourceName": "Azure Databricks AIDA API REST v4 (D9T5) TESTE",
    "credentialDetails": {
        "credentialType": "Key",
"credentials": "XX=",
        "encryptedConnection": "Encrypted",
        "encryptionAlgorithm": "RSA-OAEP",
        "privacyLevel": "Organizational"
    }
}

 The issue are related with some missing slashes. This version works well!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.