1
votes

I am trying to create a DB first Entity Framework(EF6) out of an SQL DB hosted in Azure. The DB has Azure MFA ("Universal with MFA Authentication") type of auth.

The issue is that I am unable to create DB first EF from the DB with "Azure MFA" auth. While creating EF in the Visual Studio, the authentication type of DB is asked below the db server name, but there is no Azure MFA option listed below.

enter image description here

3
There are tons of resources. First link on google takes you here c-sharpcorner.com/article/…Jawad
@Jawad Thanks for the comment n link. Our DB has Azure MFA auth. I am unable to connect with this type of auth.Sprash95
Regarding the issue, please refer to docs.microsoft.com/en-us/azure/sql-database/…. It says that when we use .NET Framework version 4.7.2 and choose ActiveDirectoryInteractive, It produces an interactive experience by displaying dialog boxes for the user password, and then for Multi-Factor Authentication validation if Multi-Factor Authentication is imposed on this user. For more details, please refer to stackoverflow.com/questions/32699236/…Jim Xu
@JimXu We are able to connect DB thru code. We want to create EDM or EF with DB-first approach, out of DB, thats our original problem.Sprash95

3 Answers

1
votes

You must create a user for this purpose that does not require MFA.

1
votes

Visual Studio doesn't support connect Azure SQL database with MFA authentication.

SSMS and SqlPackage.exe are the only tools currently enabled for MFA through Active Directory Universal Authentication.

Please reference: Universal Authentication limitations for SQL Database and SQL Data Warehouse

Hope this helps.

0
votes

I'm sorry to dig that one up, but YES you can synchronize your EDMX within Visual Studio using MFA account.

  1. Select Authentication mode 'Sql Server Authentication'
  2. Then from the screenshot in the original post, click on 'advanced...' you should see a new window and under 'security' there is Authentication with an option called 'ActiveDirectoryInteractive' (Screen sample here)
  3. in User name: write your AZURE login (like your email address) but not your password
  4. Click 'ok' the AZURE sign in form should pop out !

This should do the trick, at least it does for me using VS2017 & VS2019.