Version info:
.NET Core Version 3.1
Hangfire Version 1.7.19
Connection string example (using Active Directory Password authentication, Azure SQL Database):
Data Source=AZURE_DATA_SOURCE;Initial Catalog=DATABASE_NAME;Authentication=Active Directory Password;Persist Security Info=True;User id=USER@COMPANY;Password=**;
The same connection string in Hangifre 1.7.6 on NET Framework 4.8 works.
The same connection in EF Core 3.0.0 on .NET Core 3.1 is working.
I am missing something?
Attached image:

Thanks.
I'm having the same problem! I'm starting to think that Hangfire cant connect do Azure Dbs with Active Directory Authentication type.
Hey @fb5000 , with a little search and help from my work colleagues, the library that Hangfire uses to connect to SQL Server instance is System.Data.SqlClient, which doesnt suport Authentication with AD.
For that to work Hangfire must change the library they`re using. I tried to fork the repo and work in a solution my self, but this kind of thing is too dificult hahaha
Here`s an open issue where people request a support for Microsoft.Data.Client #https://github.com/HangfireIO/Hangfire/issues/1514
As a workaround, you can do this with following code:
GlobalConfiguration.Configuration
.UseSqlServerStorage(
() => new Microsoft.Data.SqlClient.SqlConnection(@"Server=.\;Database=Hangfire.Sample;Trusted_Connection=True;"));
Perfect! That's was what i was looking for, it's working now.
Obrigado!
Most helpful comment
Hey @fb5000 , with a little search and help from my work colleagues, the library that Hangfire uses to connect to SQL Server instance is System.Data.SqlClient, which doesnt suport Authentication with AD.
For that to work Hangfire must change the library they`re using. I tried to fork the repo and work in a solution my self, but this kind of thing is too dificult hahaha
Here`s an open issue where people request a support for Microsoft.Data.Client #https://github.com/HangfireIO/Hangfire/issues/1514
As a workaround, you can do this with following code:
GlobalConfiguration.Configuration.UseSqlServerStorage(() => new Microsoft.Data.SqlClient.SqlConnection(@"Server=.\;Database=Hangfire.Sample;Trusted_Connection=True;"));