title: Unable to connect Azure SQL database from Python using Key Vault Secret
body: <p>My Key vault secret is</p>
  <pre><code>integrated security=False;encrypt=True;connection timeout=30;data source=yyy.database.windows.net;initial catalog=db-xxxx;user id=xx-user;password=pwd-xx
  </code></pre>
  <p>I am able to connect to Azure SQL database using the above KV secret from Azure ADF.
  I am trying to do the same thru Python code:</p>
  <pre><code>from azure.keyvault.secrets import SecretClient
  from azure.identity import DefaultAzureCredential
  import pyodbc
  
  KVUri = &quot;https://yyy-kv.vault.azure.net/&quot;
  
  credential = DefaultAzureCredential()
  client = SecretClient(vault_url=KVUri, credential=credential)
  secretName = &quot;xxxx&quot;
  print(&quot;Retrieving your secret&quot;)
  retrieved_secret = client.get_secret(secretName)
  print(f&quot;Your secret is '{retrieved_secret.value}'.&quot;)
  print(&quot; done.&quot;)
  # The code fails after this.
  with pyodbc.connect(retrieved_secret.value) as conn:
      with conn.cursor() as cursor:
          cursor.execute(&quot;SELECT TOP 3 name, collation_name FROM sys.databases&quot;)
          row = cursor.fetchone()
          while row:
              print (str(row[0]) + &quot; &quot; + str(row[1]))
              row = cursor.fetchone()
  </code></pre>
  <p>But the code fails with the below error :</p>
  <pre><code>Traceback (most recent call last):
    File &quot;first.py&quot;, line 25, in &lt;module&gt;
      with pyodbc.connect(retrieved_secret.value) as conn:
  pyodbc.InterfaceError: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')
  </code></pre>
  <p>Can you help me what changes I have to do in KV or still Azure does not support Python KV? Thanks.</p>