I have an azure sql server named "myCloudServer" and I created 2 databases in it, DB1 and DB2. I am an admin so I used the server admin "pt_admin" to create and manage those 2 databases. I wanted to give a 'read-access' to another person where he can login and do all kind of "Select" queries.
I connected to the master database and executed the following commands:
CREATE LOGIN readonlylogin WITH password='1231!#ASDF!a';
CREATE USER readonlyuser FROM LOGIN readonlylogin;
Then I went into DB1 and DB2 and executed the following commands for each database:
CREATE USER readonlyuser FROM LOGIN readonlylogin;
EXEC sp_addrolemember 'db_datareader', 'readonlyuser';
All the commands were successfully executed by "pt_admin" user. Afterward, I tried to connect (SQL Auth) using the following credentials:
username: readonlyuser
password: 1231!#ASDF!a
and it is failing for some reason with a message
cannot connect to "myCloudServer" and that the login failed for user "readonlyuser". Error Code 18456
Note that I made sure I had my IP_Address added to the firewall in azure.
Any idea how to debug or fix this issue?