cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Can we display key vault secret in Databricks notebook

Shreyash_Gupta
New Contributor III

I am using databricks notebook and Azure key vault.

When I am using below function I am getting as output [REDACTED].

'dbutils.secrets.get(scope_name,secret_name)'
 
I want to know if there is any way to display the secret in databricks.
1 ACCEPTED SOLUTION

Accepted Solutions

daniel_sahal
Esteemed Contributor

@Shreyash_Gupta 
You can simply iterate over each letter of the secret and print it.
Something like this:

for letter in dbutils.secrets.get(scope_name,secret_name):
   print(letter)

View solution in original post

4 REPLIES 4

Walter_C
Databricks Employee
Databricks Employee

In Databricks, secrets retrieved using dbutils.secrets.get(scope_name, secret_name) are intentionally redacted and displayed as [REDACTED] in notebook outputs to ensure sensitive information is not exposed. This behavior is a security feature to prevent accidental exposure of secrets.

If you need to verify the value of a secret, you should do so outside of the notebook environment, such as directly within the Azure Key Vault interface or using the Azure CLI.

I completely understand the security perspective. Just wanted to know if there is any way to do it or not.
Thankyou for your response.

daniel_sahal
Esteemed Contributor

@Shreyash_Gupta 
You can simply iterate over each letter of the secret and print it.
Something like this:

for letter in dbutils.secrets.get(scope_name,secret_name):
   print(letter)

Thanks for this solution @daniel_sahal. It is simple yet effective

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group