I'm trying to connect to SQL server from R and I'm using the Azure Active Directory Password authentication. My connection in R define as follow :
ch <- odbc::dbConnect(odbc(),
DSN = "myDSN",
Database = "dbname",
Authentication="ActivedirectoryPassword",
UID = uid,
PWD = password
)
This is failing by the following error :
Error: nanodbc/nanodbc.cpp:983: FA004: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Failed to authenticate the user 'my_user_id' in Active Directory (Authentication option is 'ActiveDirectoryPassword').
Error code 0x800401F0; state 10
CoInitialize has not been called.
However, when I test the exact same setting on Microsoft SQL Server DSN Configuration, everything is fine and I'm able to connect successfully to the same database :

Any idea if I'm missing something here ?!
