I'm connecting to two databases the first one uses 'SQL Server Authentication' the second which is the issue uses 'Active Directory Universal Authentication'.
Running this on Win 7, python 2.7.12, pyodbc v4.0.17, Microsoft Online Services Sign-in Assistant is installed and I normally access the database from MSSMS 2016.
For the first database I use the following, which works:
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=ourDatabase.database.windows.net;PORT=1433;DATABASE=ourDataBaseName;UID=USERID;PWD=PASSWORD')
The second database I've tried all of these, which don't work:
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=.\ourDatabase.database.windows.net;DATABASE=ourDataBaseName;[email protected];PWD=MyPass;Trusted_Connection=yes')
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=ourDatabase.database.windows.net;DATABASE=ourDataBaseName;[email protected];PWD=MyPass;Trusted_Connection=yes')
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=ourDatabase.database.windows.net;DATABASE=ourDataBaseName;UID=user;PWD=MyPass;Trusted_Connection=yes')
cnxn = pyodbc.connect('DRIVER={ODBC Driver 13 for SQL Server};SERVER=.\ourDatabase.database.windows.net;DATABASE=ourDataBaseName;[email protected];PWD=MyPass;Trusted_Connection=yes')
What am I missing here?