I have ASP.NET MVC app and I am trying to connect to Azure SQL database migrated on Azure. I need to set my connection string in web.config and I have no idea where to look for the user id and password. I found such a pattern in my SQL Server overview in Azure:
Server=tcp...;User ID={your_username};Password={your_password}...;
I found that there is [email protected] and read about setting Active Directory Administrator. Unfortunately I am a student and have Azure for Students where I cannot set such admin.
I assumed the login will be the name of the database 'mydb' and the password is its password. Unfortunately it does not work and it gives the following error when I am login in into my app:
System.Data.SqlClient.SqlException: Login failed for user 'mydb'.
I did not find the answer on the forum, but if there is one please let me know.
Thank you all for any help in advance :)
Check the image for user name and password reset link below. For security reasons it doesn't display the password, but you can reset it. The screen will come once you click on the server name
The portal has all information you need, under Connection Strings, including the server name (included in connection string, in the form of <servername>.data.windows.net
).
You can also see your server name in the Overview area, and if you click the server name, that takes you to the server configuration area where you can set the firewall settings (you'll need to add your client ip address to the firewall).
Your username is username@databasename
. And this is a SQL login, nothing to do with Active Directory.
You do need to add your local IP address to the server's firewall though, otherwise you won't be able to establish a connection. That's under the server's settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With