Manas Agarwal
Manas Agarwal

Reputation: 31

Authorizing Databricks CLI with SPN based Azure AD Token in ADO YML Pipeline throwing Error: Authorization Failed

I have created one yml pipeline in ADO to deploy the ADB notebooks. It's working perfectly fine with PAT based authentication but I need to use the AAD Token based authentication. I created one service principal. Granted API permissions to AzureDatabricks. Added the SPN as Contributor in ADB resource. SPN cannot be added into the databricks workspace.

Pipeline is throwing error Error: Authorization failed. Your token may be expired or lack the valid scope.

I was trying to authenticate the databricks cli with Azure AD based token but getting authorization failed error. Able to generate the AAD Token but it's throwing error Your token may be expired or lack the valid scope.

Upvotes: 3

Views: 4706

Answers (1)

Kyle Hale
Kyle Hale

Reputation: 8120

You can add a service principal to a Databricks workspace (this link is to use the SCIM API but you can also use the UI if you have account level access.) - in fact you must for its AAD token to have permissions to use the Databricks APIs.

EDIT: Link to tutorial using Terraform to set up SP in Databricks and give it permissions to run a job.

Upvotes: 1

Related Questions