I am using EF Core to connect to a Azure SQL Database deployed to Azure App Services. I am using an access token (obtained via the Managed Identities) to connect to Azure SQ
For those who still fall on the same problem, I've solved the problem by using a DbInterceptor
so I can asynchronously get the token without blocking the application. I had opened an issue on EF Core repo but I've closed with the solution:
https://github.com/dotnet/efcore/issues/21043
I hope it help.