Connecting Power BI to Azure Databricks

Written by: Chris Sutcliffe

August 1, 2019

If you're already using Azure Databricks and you're wanting more rich data visualizations, Power BI is a great tool for just that. 

With just a few quick steps you can easily connect Power BI to Databricks, but there are a few small details you need to get you started. It's also important to remember that tables that you have created in Databricks are only available when your cluster is running.

Step 1: Create connection URL

Assuming you have access to your Azure Databricks portal and your, login, click on Clusters

 

and select your cluster. Expand Advanced Options and click JDBC/ODBC.

JDBC.png

There you will see the HTTP Path dialog. 

Copy the first line which should look something like: sql/protocolv1/o/<workspaceid>/XXXX-XXXXX-XXX

Using this you can then create your URL which you will need later when connecting Power BI.

https://<your_region>.azuredatabricks.net:443/sql/protocolv1/o/<workspaceid>/XXXX-XXXXX-XXX

Step 2: Get your personal access token

To get your personal access token for authentication when connecting to your Azure Databricks cluster, click the account icon User Icon.png 

Then click on User Settings

User Settings.png

On the Access Token tab, click Generate New Token:

Generate Token 1.png

You will be prompted for a comment and the lifetime of the token, enter any approriate values (its a good idea to keep this short, the default is 90 days) and click ok.

The token will then be generated for you, you wont be able to see it again so its recommended to save this somewhere safe, such as Azure Key Vault or another password management tool.

Generate Token 2.png

Step 3: Connect with Power BI

Before attempting to connect, ensure your cluster is running.

Open Power BI, click Get Data then choose "Spark" and click ok.

Spark Connector.png

Paste the URL you created in Step 1 in the Server dialog box and from the Protocol dropdown menu, select HTTP and click ok.

 Spark Connector 2.png

On the next screen, enter the username as "token" and past the personal access token you created in Step 2 in the password dialog box. Then click connect.

Spark Connector 3.png

You will then be presented with the Power BI Navigator with the list of tables available to you to import into Power BI.

Summary

In this blog we work through the various steps to prepare the necessary connection string and credentials for connecting Power BI to Azure Databricks. 

If you need more information on using Azure Databricks or you would like to implement Azure Databricks for your organization, our experienced consultants can help. Contact us below!