2

Returns error 'Keyword not supported: 'authentication'' while trying to create a context using EF Core

"Data Source=tcp:XXXXXXX.windows.net,1433;Initial Catalog=XXXXX;Persist Security Info=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication=Active Directory Integrated"

suresh
  • 329
  • 2
  • 4
  • 8
  • Try setting up the connection string for the database in the Function App application settings like this: Data Source=.database.windows.net;Initial Catalog=; http://azurecorner.com/using-managed-service-identity-in-azure-functions-to-access-azure-sql-database/ https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi – Ketan Mar 07 '19 at 11:46
  • I tried your suggestion and getting this error. 110003;Invalid user or password – suresh Mar 07 '19 at 11:55
  • Please refer to this thread https://stackoverflow.com/questions/45597736/azure-sql-database-connection-using-active-directory-integrated-authentication-f – Alberto Morillo Mar 07 '19 at 14:48

2 Answers2

2

Azure Functions V2 builts on top of .Net Core and AFAIK SqlClient for .NET Core still does not support using the 'Authentication' keyword in the connection string. That should work when this issue is actually fixed.

Ketan
  • 1,530
  • 7
  • 16
0

You can reference this bob: Azure Active Directory Connection String.

It has the same error with you. And the answer gives two suggestions:

  1. Have you been through this troubleshooting guide: Use Azure Active Directory Authentication for authentication with SQL.

  2. do you have .NET Framework 4.6 or later installed?

Follow this two suggestions, the problem is solved. I think you can try it and maybe it can helps you.

Hope this helps.

Leon Yue
  • 15,693
  • 1
  • 11
  • 23
  • Does https://github.com/dotnet/SqlClient now support the 'Authentication' keyword for AD? – Jon Jun 09 '19 at 19:18