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