Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to look for UserId and Password for Azure SQL Server Connection

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 :)

like image 569
Bart Avatar asked Sep 21 '18 17:09

Bart


2 Answers

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 server name

reset link

like image 174
cherish sham Avatar answered Nov 15 '22 11:11

cherish sham


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.

like image 27
David Makogon Avatar answered Nov 15 '22 10:11

David Makogon