• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Unable to create token in databricks using service principal

Resolved: Unable to create token in databricks using service principal

0
By Isaac Tonny on 15/03/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve Unable to create token in databricks using service principal

Question:

I have the below code to create token in the databricks workspace, script is using the SPN for authentication which is added as user to the workspace and member to the admin group.
I continue to get unauthorized access error, am I doing something wrong here?

Best Answer:

I tried to reproduce the same in my environment and got the same error as below:
enter image description here
The error usually occurs if the required roles is not granted to the Service Principal or if permissions are missing to perform the action.
Make sure to grant API permissions to the Azure AD Application like below:
enter image description here
Now, grant roles to the service principal like below:
Go to Azure Portal -> Azure Databricks ->Select your Databricks -> Access control (IAM) -> Add a role assignment -> Select Owner -> Search your service principal -> Save
enter image description here

Note that : Make sure to assign owner or contributor role to the Azure AD Application. Refer this.


If still the issue persists, try the below PowerShell script:
enter image description here
References:
PowerShell Gallery | Public/Connect-Databricks.ps1
Oauth 2.0 – access Azure Databricks API through Active Directory by Carl Zhao

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

azure-databricks databricks powershell
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How do I use SetWindowText with Unicode in Win32 using PowerShell?

01/04/2023

Resolved: Shopware 400 Status Error “This value is too long. It should have 255 character or less.” When I Try Updating Database Table

01/04/2023

Resolved: Using AWK to count multiple patterns in a file

01/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.