Where to look for UserId and Password for Azure SQL Server Connection
Asked Answered
M

2

14

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

Massage answered 21/9, 2018 at 17:59 Comment(0)
G
13

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

Gwendolyn answered 3/5, 2021 at 7:40 Comment(2)
I see everywhere about this "reset password".... but reset it to what exactly? I have a new environment including sqlserver db created via terraform and cannot determine the sqladmin password....Overcash
For anyone wondering on how to do it, in your SQL database > click on "Overview" in left menu > click on "Server name" > click on "Reset password" > create a new password. You can change to any password, as long as you obey the constraints you will find listed there.Skilken
V
1

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.

Viewy answered 22/9, 2018 at 2:45 Comment(2)
@MykhayloKopytonenko - the OP's question wasn't about user management (which is fully documented elsewhere such as learn.microsoft.com). The question was strictly about finding and using the original credentials and connecting to the database properly. And the OP was also confused about the login being related to Active Directory, which I clarified.Viewy
@MykhayloKopytonenko - Kind of strange to downvote me though, given that my answer was directly relted to the question being asked.Viewy

© 2022 - 2024 — McMap. All rights reserved.