Azure Key Vault with Databricks

https://<databricks-instance>#secrets/createScope. Post successful authentication you will get the databricks instance like below https://xxxxxxxxxxxx.x.azuredatabricks.net/#secrets/createScope
Define the Scope Name. We will use this scope name in the codebase
import mysql.connectorUsername = dbutils.secrets.get(scope = "scope_name",key = "user")
Password = dbutils.secrets.get(scope = "scope_name",key = "password")
mydb = mysql.connector.connect(
host="mysql.xxxx.xxx",
user=Username,
password=Password
)
mycursor = mydb.cursor()
mycursor.execute("SHOW DATABASES")
for x in mycursor:
print(x)

--

--

--

DevOps Engineer with 10+ years of experience in the IT Industry. In-depth experience in building highly complex, scalable, secure and distributed systems.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Reasons You Should Learn Web Development

Developer log #2 : introduction about MBxOC battle suit (2)

My Attempt at Advent of Code 2021 in Kotlin

ELK (Elastic) Stack Single Sign-On (SSO) with WSO2 Identity Server via OIDC

3 Fundamental Built-in Function for Beginner

Scaling Meddy’s AWS Infrastructure

CS371P Fall 2020: Grant Larson

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ankur

Ankur

DevOps Engineer with 10+ years of experience in the IT Industry. In-depth experience in building highly complex, scalable, secure and distributed systems.

More from Medium

Databricks CI/CD using Azure DevOps — part I — CI

Snowpark & Scala — Snowflake experiment

How to store secrets in Azure Databricks

Azure Databricks

Creating Metadata Views (Information Schema) for Databricks