cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Service Principal to connect PowerBI to Databrick SQL Warehouse

pgruetter
Contributor

Hi all

I'm struggling to connect PowerBI service to a Databricks SQL Warehouse using a service principal.

I'm following mostly this guide.

I created a new app registration in the AAD and created a client secret for it.

Now I'm particularly struggling with the second step of adding the service principal to the Databricks account.

If I open the link accounts.azuredatabricks.net, I can select the correct workspace after authentication, but this only brings me to the welcome page of the Databricks workspace.

I can't find the "User management" page that is mentioned.

--> Where / how can I add the service principal to Databricks ?

Thanks for any help

1 ACCEPTED SOLUTION

Accepted Solutions

pgruetter
Contributor

In the end, once the Service Principal is properly authorized on the Databricks side, I had to create a Personal Access Token for the Service Principal using the Databricks API.

On the Power BI service side I then had to use username = 'token' and as password the generated PAT.

View solution in original post

7 REPLIES 7

Anonymous
Not applicable

@pgruetter​ :

To add a service principal to Databricks, you need to follow the steps below:

  1. Go to the Azure Databricks portal and navigate to the "Workspace" section.
  2. In the left pane, click on "User Management" and then select "Credentials" from the drop-down menu.
  3. Click on the "Add" button and select "Service Principal".
  4. Enter the client ID and client secret that you created in Azure AD when you registered your app.
  5. Select the appropriate Azure Databricks workspace and click "Create".

After following these steps, you should be able to connect Power BI service to Databricks SQL Warehouse using the service principal.

pgruetter
Contributor

Thanks for the feedback. My problem is, that I don't have a "User Management" in the left pane.

In the meantime, I found the reason for that: The description only works if you're using Unity Catalog. In this case, we don't use Unity Catalog yet.

Anonymous
Not applicable

Hi @pgruetter​ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

pgruetter
Contributor

I couldn't completely solve this issue yet. But I think I managed to add the service principal to the classical Databricks Workspace by going to the Admin Console --> Groups --> edit "admins" group.

pgruetter
Contributor

In the end, once the Service Principal is properly authorized on the Databricks side, I had to create a Personal Access Token for the Service Principal using the Databricks API.

On the Power BI service side I then had to use username = 'token' and as password the generated PAT.

Hello 

I was wondering if you could elaborate on the solution to the issue you posted. We have a Power BI dataset based upon tables in a databricks sql warehouse. I have followed the steps to create an access token for the service principal which is registered in the databricks workspace with admin permissions. However when changing the credentials for the power bi data source we specified authentication method = Username/Password and entered the word Token in the username field and the PAT token generated on behalf of the service principal.

amiebarkes_0-1698846437329.png

This resulted in an error

amiebarkes_1-1698846488517.png

I was wondering if we had correctly followed your procedure?

Kind regards

Amie

 

AmanSehgal
Honored Contributor III

Please check if you have enabled the service principal to use PAT token in admin settings.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group