Search code examples
sql-serverexcelazuredatasource

How to use MFA with SQL Server Datasource embedded in MS Excel file


I have an excel file that retrieves data from Azure SQL Database. I want to force MFA on the connection. I have gone through MS documentation and set up connection string as recommended in the documentation.

server=server;database=database;Authentication=ActiveDirectoryIntegrated;

When I use this in SSMS, it works like a charm. I get text message with authentication code. But when I use the same connection string inside excel file, it simply prompts with a login dialog box and asking to end credentials.

Is there a way to enable MFA for SQL Server connection when it is embedded in Excel file?


Solution

  • These is no document talk about how to configure MFA as the default authentication when connect to Azure SQL database from Excel.

    But we can use MFA to connect to SQL database by some other ways. You could follow my steps:

    I'm using Excel 2016.

    1. Data-->From Other Sources-->From Data Connection Wizard:

    enter image description here

    2. Select: Other/Advanced

    enter image description here

    3. Choose Microsoft OLEDB Driver for Sql Server, Next:

    enter image description here

    4. We can using the MAF authentication to connect to the Azure SQL:

    enter image description here

    5. Choose the table:

    enter image description here