I am writing a python script that connects to Azure Serverless SQL and exports the rows for a given query. I am using sqlalchemy. I build the connection string
connection_string = 'DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';Authentication=ActiveDirectoryInteractive;Encrypt=yes;TrustServerCertificate=no;UID='+username
and it prompts for a password as expected
When I change it to this
connection_string = 'DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';Encrypt=yes;TrustServerCertificate=yes;UID='+username+';PWD ='+password+';Authentication=ActiveDirectoryPassword'
It throws this message
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
How can I get it not to prompt for a password on the connection since I prompt for it before hand. Since I am running several python scripts that do this, I only want to have to enter my password once.
I am using version 17.10.6.1 on a windows 11 machine
Authenticationmethods are only available in recent versions of the driver, some are only available on Windows clients.