cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Articles
Dive into a collaborative space where members like YOU can exchange knowledge, tips, and best practices. Join the conversation today and unlock a wealth of collective wisdom to enhance your experience and drive success.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Configure Databricks Access to Keyvault with Azure Role Based Access Control (RBAC)

konda1
New Contributor

Set up required : Key vault

go to settings: Access Configuration, check Azure Role Based Access control under permission model

go to Network: Allow trusted azure services to send request

Create Access connector for Databricks from portal

go to IAM in KV >> Add Role Assignment >> Managed Identity >> select the databricks Access Connector created above >> Add Role as >> Keyvault Secret User

Go To Databricks >> Login as Account Admin

go to Catalog: 

Enter Credential name: adb-azkv-credential

IAM Role ARN : Resource id of the access connector which has access to KV. (Open Access connector in portal and click on view Json on over view page. Copy ID)

Click Create.

Provide Access to use the credential from either ui or with code as below

GRANT ACCESS ON SERVICE CREDENTIAL `credential-name` TO `user@xxxxx.onmicrosoft.com`;

once these steps are completed:

go to notebook and test the connection with below code

%pip install azure-keyvault-secrets

from azure.identity import ManagedIdentityCredential

from azure.keyvault.secrets import SecretClient

kv_url = "https://kv-xxxxx.vault.azure.net/"

credential = dbutils.credentials.getServiceCredentialsProvider('credentialname')

secret_client = SecretClient(vault_url=kv_url, credential=credential)

secret_value = secret_client.get_secret("secret-name").value

print(secret_value)

 

konda1_0-1786970201005.png

networkconfig_KV.jpg

KeyvaultConfig.jpg

0 REPLIES 0