On-behalf-of token creation for service principals is not enabled for this workspace

Ajay-Pandey
Databricks MVP

Hi All

I just wanted to create PAT for Databricks Service Principle but getting below code while hitting API or using CLI - 

AjayPandey_0-1710845262519.pngAjayPandey_1-1710845276557.png

Please help me to create PAT for the same.

#dataengineering #databricks

Ajay Kumar Pandey

@Retired_mod I have already referred this one but still having issue
I have created Service Account in Databricks and I am not using Azure Service Principle

Ajay Kumar Pandey

Ajay-Pandey
Databricks MVP

Hi @Retired_mod ,

I have given all the permissions (Admin) to Service Principle and still having the same issue.

Please find all the details below - 

AjayPandey_0-1710860431811.png

AjayPandey_1-1710860497811.png

 

 

Ajay Kumar Pandey

Ajay-Pandey
Databricks MVP

Hi @Retired_mod 
Have you got any update on this ?

Ajay Kumar Pandey

MorpheusGoGo
New Contributor II

This only works if you are on AWS or GCP, no support for Azure 😞 

Check the API documentation AWS - https://docs.databricks.com/api/workspace/tokenmanagement/createobotoken

No such documentation exists for Azure.

JackB
New Contributor II

You can generate the token while logged in as the Service Principle via the Azure CLI in a Command Prompt window.  To do so, make sure to install the Azure CLI and the Databricks CLI with it.

I used the following commands in the Command Prompt window.  Hope this helps.

First Command – Log in as the Service Principal using the secret value.  The secret value is created via https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal#opti...

az login --service-principal -t <tenant id> -u <client id> -p <secret value> --allow-no-subscriptions

 Second Command while logged in as the Service Principal

databricks tokens create --lifetime-seconds 15780096 --comment <service principle name>