need to fetch secrets from key vault in my local

KVNARK
Honored Contributor II

Could you please look into this if I'm missing something. Getting the below error:

azure.core.exceptions.ServiceRequestError: Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.

Using below function for that.

def get_auth_creds(KVUri, keyVaultName, username, password):

print(" loading credentials for local system ")

credential = DefaultAzureCredential(connection_verify=False, exclude_shared_token_cache_credential=True)

client = SecretClient(vault_url=KVUri, credential=credential)

print("Retrieving your secret from {}.".format(keyVaultName))

user = client.get_secret(username).value

pwd = client.get_secret(password).value

return user, pwd