I'm working on a project where I'm using an Azure connection string. During development, I'm running against SQL Server Express. However, when I try to connect to the database context, I encounter this error:
"Windows logins are not supported in this version of SQL Server. (.Net SqlClient Data Provider)"
. I then open SSMS (Microsoft SQL Server Management Studio) to connect to an Azure SQL database. I select "SQL Server authentication" and enter the username and password, but I still encounter the same error. 
Answer:

I received the same error message and then decided to modify my connection string.After adding "Trusted_Connection=False;Encrypt=True;", it worked for me.if it still doesn't work for you, you can also try "Integrated Security=False" 

By modifying the connection string to explicitly specify "Trusted_Connection=False" and "Encrypt=True" can be good  solution to solve authentication issues, especially when working with Azure SQL Database, this ensures that SQL Server Authentication is explicitly used instead of relying on Windows Authentication and enabling encryption enhances the security of the connection.

If the issue persists, setting "Integrated Security=False" disables Windows Authentication.

2

In our experience with SSMS(SQL Server Management Studio) , we encountered a bug where manually selecting Windows authentication caused issues when connecting to Azure and  to solve this, we found that restarting SSMS by closing it from the task manager resolved the issue.

If you're still facing issues, you can try the following approach: If you're using SSMS and receiving this error message even though you're not selecting Windows Authentication, you're not alone. 

On a new Windows + SSMS(SQL Server Management Studio) install, we encountered the same issue when trying to connect via "File > Connect Object Explorer". Despite selecting SQL Server Authentication, we received an error about Windows Authentication not being supported. After trying multiple times, we found success by logging in using "Object Explorer > Connect > Database Engine".

My View on This Solution

This workaround highlights a bug in SSMS 2019 where manual selection of Windows authentication can cause connection issues with Azure. Restarting SSMS and carefully filling out the fields can resolve this issue. Additionally, if the problem persists, connecting through "Object Explorer > Connect > Database Engine" instead of "File > Connect Object Explorer" may provide a workaround. It's important to be aware of such bugs and to explore alternative methods for connecting to ensure a smooth experience with SSMS and Azure.

3

Resolving Azure "Windows logins are not supported in this version of SQL Server"

If you are getting the error message "Windows logins are not supported in this version of SQL Server" in Azure, it typically means that the authentication method used is not compatible with the version of SQL Server being accessed.

Check SQL Server Authentication Mode

First, we need to ensure that SQL Server is configured to allow SQL Server Authentication and this can be done through SQL Server Management Studio (SSMS) or by executing T-SQL commands.

To check the authentication mode using T-SQL, we can use the following query:


    EXEC sp_helpserver
  

This query will return information about the authentication mode of the server , ensure that "login_mode" is set to "Mixed" mode to allow both Windows Authentication and SQL Server Authentication.

Use SQL Server Authentication

If the SQL Server is configured for Mixed mode authentication, we should connect using SQL Server Authentication instead of Windows Authentication. Here's an example of how we can connect using SQL Server Authentication in C#:


    string connectionString = "Server=ServerAddress;Database=TestDb;User Id=sa;Password=passs@1234;";
    SqlConnection connection = new SqlConnection(connectionString);
    connection.Open();
  

Check Azure SQL Database Compatibility Level

If above two solution not worked for you then ensure that the compatibility level of the Azure SQL Database is appropriate for the version of SQL Server being accessed.

4

If you're encountering issues with the connection string, it's likely due to using an incorrect format. Below is this is the connection string format that resolved the issue for me:


    "ConnectionString": "Server=tcp:3737.database.windows.net,1433;Database=TestDb;User ID=sa;Password=pass@1244;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
  

It's important to note that integrated authentication is NOT supported in SQL Azure and only SQL Authentication is supported, which means providing a username and password in the connection string.