cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to generate account level PAT for service principle

NarenderKumar
New Contributor III

I am trying to generate PAT for a service principle.
I am following the documentation as shown below:
https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html#create-token-in-account

NarenderKumar_0-1715695724302.png

I have prepared the below curl command:

NarenderKumar_1-1715695859890.png

I am getting below error:

NarenderKumar_2-1715695895738.png

Please help me to create the curl command that can generate the PAT

1 ACCEPTED SOLUTION

Accepted Solutions

NarenderKumar
New Contributor III

I was able to generate the workspace level token using the databricks cli.

I set the following details in the databricks cli profile(.databrickscfg) file:

 

host  = https://myworksapce.azuredatabricks.net/ 

account_id = (my db account id)

client_id     = (my sp client id)

client_secret = (generated from databricks worksapce)

 

After setting these, I ran the following command and generated the token:

databricks tokens create --lifetime-seconds 157680000

View solution in original post

2 REPLIES 2

Hi @Retired_mod  Thank you for the details.

1. The command that you have shared takes token in the header, but the command that I am trying to use is to generate the token for a service principle

2. The command shared by you is not taking a client id and client secret. so how can we generate it for a service principle

3. we can generated tokens at the account level and workspace level. The command shared by you is at workspace level not at the account level.

Please help me if you know how to generate PAT for a service principle at the account level.

NarenderKumar
New Contributor III

I was able to generate the workspace level token using the databricks cli.

I set the following details in the databricks cli profile(.databrickscfg) file:

 

host  = https://myworksapce.azuredatabricks.net/ 

account_id = (my db account id)

client_id     = (my sp client id)

client_secret = (generated from databricks worksapce)

 

After setting these, I ran the following command and generated the token:

databricks tokens create --lifetime-seconds 157680000

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