ODBC connection to Azure SQL database using AD Integrated Authentication fails from Azure VM.

rdyaz
rdyaz used Ask the Experts™
on
I've copied an on-premise SQL database to Azure SQL for testing, using the Azure online migration process, which is done and the database is in ready to cutover mode..  
From a local Windows 10 machine using ODBC driver 17, I can set up an ODBC connection to the Azure SQL database using Active Directory Integrated security and it works fine.
From the same machine, SSMS 17 connects to the Azure SQL database fine.
However when I try the same ODBC connection from an Azure VM (Server 2016, joined to the local domain via VPN) I cannot get it to authenticate even with the same domain user.  On the VM, I've tried ODBC driver 13.1 and 17.2.  Here is the error message I get:

"Microsoft ODBC Driver for SQL Server Version 13.00.4414

Running connectivity tests...

Attempting connection
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Failed to authenticate the user '<user>' in Active Directory (Authentication option is 'ActiveDirectoryIntegrated').
Error code 0xCAA9001F; state 10
Integrated Windows authentication supported only in federation flow.

TESTS FAILED!"

I'm not sure why this would be any different for an Azure VM than a local machine--both are domain joined.
-Azure AD Connect is synchronizing users to Azure.
-I have the firewall open on the Azure SQL database server to allow both local subnet and the Azure vNet the VM is on.
-I have the ADAL for SQL Server and the Microsoft Online Services Sign-in Assistant both installed on the VM.

Thanks for any help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Shreedhar EtteTechnical Manager
Top Expert 2010

Commented:
Hi Rdyaz,

Looking at the error "Integrated Windows authentication supported only in federation flow." We can conclude that Azure Active Directory has to be federated.

Further refer this article to better understand the requirements:
https://stackoverflow.com/questions/39367634/sql-azure-integrated-authentication-with-a-cloud-only-azure-active-directory-fai

Author

Commented:
Thanks for the reply.  If federation was required, how could this be working for an on-premise machine accessing Azure SQL?
Commented:
I found out that for some reason this worked after installing SMSS 17.9.1, and still works after uninstalling it.
 
I narrowed it down to the SMSS install upgrading Active Directory Authentication Library for SQL Server to version 14.0.1000.169.
I had previously installed version 13.0.1300.275 (which was the only one I could find online).

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial