I am wanting to user the logged in Windows credentials of Visual Studio Code as a pass through to authenticate to an Azure SQL database.
Below is my python code using odbc driver 18.
connectionString = f'Driver={{ODBC Driver 18 for SQL Server}};Server={SERVER};Database={DATABASE};Authentication=ActiveDirectoryIntegrated;Encrypt=yes'
conn = pyodbc.connect(connectionString)
The error I'm receiving is:
pyodbc.Error: ('FA004', "[FA004] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Failed to authenticate the user '' in Active Directory (Authentication option is 'ActiveDirectoryIntegrated').\r\nError code 0xCAA2000C; state 10\r\nAADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access ...