11

You can create scopes in Databricks backed by Azure Keyvault instead of using the Databricks CLI. However, when you try to create a Scope, an obscure error message (with a spelling mistake!) is shown. It appears as not many people encounter this error:

"Internal error happened while granting read/list permission to Databricks ervice principal to KeyVault: XYZ"

Setting the Manage Principal to All Users does NOT help in this case.

enter image description here

Tony Ju
  • 14,891
  • 3
  • 17
  • 31
Rodney
  • 5,417
  • 7
  • 54
  • 98

2 Answers2

11

I figured that this was a Service Principal issue in Azure AD. This particular user I was logged on to Databricks with was not an AD contributer and only had Contributer role on the Databricks and Keyvault service. I could not find any default Object ID in AD for Databricks so I assumed it was creating a service principal on the fly and connecting Databricks with Keyvault (I might be wrong here - it might already exist in AD when you enable the Databricks resource provider).

Logging in as an Admin with the rights to create service principals solved the problem. After that you can see in the Key Vault the DB service principal used in for the key retrieval:

enter image description here

Rodney
  • 5,417
  • 7
  • 54
  • 98
  • 3
    The 'AzureDatabricks' service principal already exists; it is in Azure Active Directory as an Enterprise Application (https://portal.azure.com/#blade/Microsoft_AAD_IAM/ManagedAppMenuBlade/Overview/appId/2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/objectId/bf7cad41-7aa5-4861-b2c2-0338ae283d12). You don't need permission to create service principals for this process to work, but you do need to have Owner permission on the Key Vault so that it can create an access policy for 'AzureDatabricks'. – rcabr Oct 28 '19 at 19:47
2

As mentioned by @rcabr in his above comment there is already an SP by name 'AzureDatabricks' inside Enterprize Application, you need to get the object id details and add it in the access policy of the key vault. With this, the Databricks will be able to access the KeyVault enter image description here

  • 1
    I tried to search this enterpirse app in ad enterprise app menu and not able to find. So I directly went to KV IAM and search for *AzureDataBricks* it appeard and I assigned – Jayendran Sep 16 '21 at 09:07