FSharp.Data.SqlClient icon indicating copy to clipboard operation
FSharp.Data.SqlClient copied to clipboard

Support for 'Active Directory Interactive' authentication

Open sachinshahredmane opened this issue 2 years ago • 3 comments

problem

Try to connect to an Azure SQL database using the Active Directory Interactive authentication scheme.

open FSharp.Data

[<Literal>]
let connectionString = @"Data Source=asdf.database.usgovcloudapi.net;Initial Catalog=asdf;User [email protected];Authentication='Active Directory Interactive';TrustServerCertificate=True;Connect Timeout=30"

do
    use cmd = new SqlCommandProvider<"select * from records", connectionString>(connectionString)

    cmd.Execute(topN = 3L) 

This provides the following error message:

Severity	Code	Description	Project	File	Line	Suppression State
Error	FS3033	The type provider 'FSharp.Data.SqlCommandProvider' reported an error: Cannot find an authentication provider for 'ActiveDirectoryInteractive'.	CopyDataDbToDb	C:\projects2\CopyDataDbToDb\CopyDataDbToDb\Program.fs	7	Active

solution

Ideally, that the authentication scheme is supported

more info

For now, I have copied the DB onto my local machine so I can work with it, but the data will quickly become stale.

What you can do

  • [ ] I consider contributing the feature
  • [x] I consider help in testing the feature

sachinshahredmane avatar Oct 25 '23 22:10 sachinshahredmane

@sachinshahredmane, could you confirm you can connect to the same database using a plain SqlConnection from System.Data.SqlClient namespace with the same connection string?

smoothdeveloper avatar Oct 25 '23 23:10 smoothdeveloper

I was only able to connect using the Microsoft.Data.SqlClient namespace. Any chance of upgrading to that driver?

sachinshahredmane avatar Nov 22 '23 02:11 sachinshahredmane

Well, I just found #374 so I think I will wait to see if/how things develop.

sachinshahredmane avatar Nov 22 '23 02:11 sachinshahredmane