1
com.databricks.common.client.DatabricksServiceHttpClientException:
PERMISSION_DENIED: Invalid permissions on the specified KeyVault https://azkv*.vault.azure.net/.
Wrapped Message:
  Status code 403,
  {"error":
    {"code":"Forbidden","message":
       "Caller is not authorized to perform action on resource.\r\n
        If role assignments, deny assignments or role definitions were changed recently, please observe propagation time.\r\n
        Caller: name=AzureDatabricks;appid=2vf8v4a6-3304-4ab8-85cb-cd0e6f879c1d;oid=4e924d0e-ad49-4acc-baec-6d612e920502;iss=https://sts.windows.net/552af62d-5878-4131-8695-1e87b0f89945/\r\n
        Action: 'Microsoft.KeyVault/vaults/secrets/getSecret/action'\r\n
        Resource: '/subscriptions/6b60a61d-3e92-4501-8794-fd7725066113/resourcegroups/streamproject/providers/microsoft.keyvault/vaults/azkv*/secrets/clientsecret'\r\n
        Assignment: (not found)\r\n
        DecisionReason: 'DeniedWithNoValidRBAC' \r\n
        Vault: azkv*;location=eastus\r\n",
      "innererror":{"code":"ForbiddenByRbac"}
    }
  }

I have been trying to mount ADLS to databricks using service principal and secret scope. I can't access the key vault it seems.

How could I solve this?

Krokomot
  • 3,208
  • 2
  • 4
  • 20
Sanjeev
  • 13
  • 5
  • im also facing this error com.databricks.common.client.DatabricksServiceHttpClientException: PERMISSION_DENIED: Invalid permissions on the specified KeyVault https://dbsacctkv01.vault.azure.net/ .. but when i navigate to Access Policies it says access policies not availabe – Siva Aug 08 '23 at 12:03

3 Answers3

1

You must add the identity in the access policy blade enter image description here

then you set the required permissions for the secret scope enter image description here

later select the corresponding service principal of your databrick enter image description here

And then you create the policy enter image description here

enter image description here

Hope this helps!

SoySolisCarlos
  • 736
  • 1
  • 6
  • 13
0

First of all, check your Key-vault permission model under your Key Vault -> Settings -> Access Configuration on Azure portal.

Azure keyvault mainly allows key vault access using two permission models.

  1. Azure role-based access control (recommended)
  2. Vault access policy

enter image description here

If you are using Azure role-based access control (recommended), make sure that you have given 'Key Vault Administrator' role to your service principal from Access Control (IAM) section of your key vault.

enter image description here

If you are using Vault access policy, make sure that you have added policy for your service principal with necessary permissions under Access Policies section of your key vault.

enter image description here

Mostly, this might fix your issue.

Yash Mochi
  • 769
  • 6
  • 15
0

I just faced a similar issue. Here is how I solved it. It might help you too.

I'm using RBAC in my Key Vault. I had to give the "Key Vault Administrator" role to my Databricks Application. The problem I was having is that I couldn't find the Databricks Application when listing its object id in the Key Vault's Access control. Therefore, I followed these steps. After adding my role through the Azure CLI:

az role assignment create --assignee-object-id 11111111-1111-1111-1111-111111111111  --role "Key Vault Administrator" --scope "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}"

Then I stopped getting the RBAC error. This was independent of using a Service Principal. Good luck!