We left Russia. We are against aggression and war with Ukraine. It is a tragedy for our nations, it is a nightmare

Using Microsoft.Data.SqlClient in Hangfire.SqlServer?

Currently running into an issue where my connectionstring looks like this:

Data Source=myserver.database.windows.net;Initial Catalog=mydb;Persist Security Info=True;User ID=me@myactivedirectorydomain.com;Authentication=ActiveDirectoryInteractive

The Authentication keyword isn’t supported in System.Data.SqlClient (and ActiveDirectoryInteractive requires Microsoft.Data.SqlClient greater than version 3) - it looks like Hangfire.SqlServer uses Syste.Data.SqlClient; do I have any options for using a different library for SqlClient?

You can initialise SQL Server-based storage in the following way in order to utilise the Microsoft.Data.SqlClient package. Looks like it will be used by default in 1.8.0 version (when it is finally released), but we can’t change the defaults in 1.7.X, because of recent changes in MD.SqlClient 4.0 that forces authentication to be used by default and requires to change connection string sometimes.

Hangfire can use both System.Data.SqlClient and Microsoft.Data.SqlClient packages and is tested against both of them.

        () => new Microsoft.Data.SqlClient.SqlConnection(@"Server=.\;Database=Hangfire.Sample;Trusted_Connection=True;"));