I'm attempting to connect to Azure SQL Database via Entity Framework with a connection string similar to this:
Data Source=<server>.database.windows.net;Authentication=Active Directory Integrated;Initial Catalog=<database>
The connection attempt is made within the context of a hosted WPF form running inside AutoCAD 2018. The project is built using .NET Framework 4.6 and EF 6.1.3.
I'm encountering the following error:
Unable to load adalsql.dll (Authentication=ActiveDirectoryIntegrated). Error code: 0x2. For more information, see http://go.microsoft.com/fwlink/?LinkID=513072
Unfortunately the help link doesn't lead to page that provides technical details for this issue. I haven't so far discovered anything on the web elucidating the root cause.
I've also tried this connection string:
Server=tcp:<server>.database.windows.net,1433;Initial Catalog=<database>;Persist Security Info=False;User ID=<username>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Integrated"
It was copied from the Azure portal's ADO.NET (Active Directory integrated authentication)
section. However, with this connection string I get the following error Cannot use 'Authentication=Active Directory Integrated' with 'User ID', 'UID', 'Password' or 'PWD' connection string keywords
But it doesn't contain a password segment. And after removing the User ID
segment, I still get the Unable to load adalsql.dll ...
error.