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: 

Passing the secret scope to the url

SrinMand_34861
New Contributor II

We are trying to call an URL by using the credentials,

we are able to get the data when we hard code the credentials.

Not returning any data when we pass the secret scope credentials.

below is the code.

import requests

source_db_scope = "dev-hnd-secret-scope"

source_user_name_secret = "username"

source_password_secret = "password"

username = dbutils.secrets.get(scope = source_db_scope, key = source_user_name_secret)

password = dbutils.secrets.get(scope = source_db_scope, key = source_password_secret)

url = "http://abc.com:8000/scheduler_etl.xsjs"

response = requests.get(url,auth=(username ,password ))

Can you please suggest. Appreciate your help

Thanks

Srini

4 REPLIES 4

Hubert-Dudek
Esteemed Contributor III

please try to debug what secret scope is returning. The ugly way to do it is:

for letter in username:

print(letter, ' ')

Secret scope masks the value and returns [Redacted] for both username and password.

Hubert-Dudek
Esteemed Contributor III

try

for letter in username:
    print(letter, end=" "')
    print("\n")

I'm able to print the credentials and they are correct.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now