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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.