I have a web application in visual studio 2017 .NET framework 4.7.1 with identity, that connects to azure sql server database. I am getting an error after submitting login form. The exception message is: "Server name cannot be determined. It must appear as the first segment of the server's dns name (servername.database.windows.net). Some libraries do not send the server name, in which case the server name must be included as part of the user name (username@servername). In addition, if both formats are used, the server names must match."
The error is only in the web server (azure app service). When I run it locally (localhost) it works fine.
I did what error message suggests but, it did´nt work. I searched about this but, none of the suggestions or solutions I found have worked.
If I remove login stuff, application is able to connect and works so, the problem seems to be the connection string I use to connect to identity tables.
I have tried this connection strings in web.config but none of them have worked:
1. add name="DefaultConnection" connectionString="Server=tcp:myServer.database.windows.net,1433;Initial Catalog=myDatabase;Persist Security Info=False;User ID=myUser@myServer;Password=myPassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False" providerName="System.Data.SqlClient"
2. add name="DefaultConnection" connectionString="Data Source=myServer.database.windows.net;Initial Catalog=myDatabase;Integrated Security=False;User Id=myUser;Password=myPassword;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"