- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 07:11 AM
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
I have prepared the below curl command:
I am getting below error:
Please help me to create the curl command that can generate the PAT
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2024 11:57 PM - edited 05-19-2024 11:58 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 06:43 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2024 11:57 PM - edited 05-19-2024 11:58 PM
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

