0
votes

I want a user that runs a PowerShell script that calls Invoke-Sqlcmd to have to provide their Azure Active Directory username, password and MFA response for authentication to the configured Azure SQL Database. I've found surprisingly little information on this topic. I tried omitting -Username and -Password but receive this error:

Invoke-Sqlcmd : Windows logins are not supported in this version of SQL Server.
3

3 Answers

0
votes

As far as I know, SSMS and SqlPackage.exe are the only tools currently enabled for MFA through Active Directory Universal Authentication. For more details, please refer to this document

If you have any idea or suggestion about Azure SQL database, you can submit them from here.

0
votes

Got this response from Azure support, I asked the same question there.

Currently SQLCMD and BCP utilities are the only supported utilities for interactive authentication. Invoke-SQLCMD is not one of the supported utilities yet.

:(

0
votes

According to the docs, they support this feature now. "The new BCP supports Azure AD authentication, including Multi-Factor Authentication (MFA) support for SQL Database and SQL Data Warehouse."

https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility