DacFx icon indicating copy to clipboard operation
DacFx copied to clipboard

SqlPackage universal authentication to Azure SQL fails with error "You can't sign in here with a personal account. Use your work or school account instead"

Open GennadyGS opened this issue 1 year ago • 2 comments

  • SqlPackage or DacFx Version: 162.2.111.2
  • .NET Framework (Windows-only) or .NET Core: 8.0.200
  • Environment (local platform and source/target platforms): Windows 11/Azure

Steps to Reproduce:

  1. Publish DAC package to Azure SQL using universal authentication with command:
dotnet tool run sqlPackage /Action:Publish /SourceFile:XXX.dacpac /tsn:XXX.database.windows.net /tdn:XXX /tec:True /ua /tid:XXX.onmicrosoft.com

Observe browser window with authentication request is opened.

  1. Input valid login [email protected] and press "Next".

Observed behavior: Error message "You can't sign in here with a personal account. Use your work or school account instead." image

All inputs are valid and checked many times in different ways. For instance, for sqlcmd universal authentication with the same inputs works as expected:

sqlcmd -S XXX.database.windows.net -d XXX -U [email protected] -G -I

image

Did this occur in prior versions? If not - which version(s) did it work in? It did not work in different way: browser window with authentication request was not opened and some error was reported.

(DacFx/SqlPackage/SSMS/Azure Data Studio): SqlPackage

GennadyGS avatar Mar 07 '24 07:03 GennadyGS

If you enter the command for universal auth without the tenant Id, do you still get the error message for "You can't sign in here with a personal account. Use your work or school account instead."?

dotnet tool run sqlPackage /Action:Publish /SourceFile:XXX.dacpac /tsn:XXX.database.windows.net /tdn:XXX /tec:True /ua

dzsquared avatar Mar 12 '24 14:03 dzsquared

Sure, double-checked it again. Of course, I have exhausted all possible workarounds before taking on the work to fill this bug report.

GennadyGS avatar Mar 12 '24 14:03 GennadyGS