Cannot login with read-only user to SQL Azure database

故事扮演 提交于 2021-02-10 22:13:13

问题


I've followed the answer to this question: In SQL Azure how what script can I use to create a read only user

I've completed all the steps successfully on the correct server. However, when I try to login to the Azure database, I'm getting the following error:

Login failed for user 'readerUser'.
This session has been assigned a tracing ID of '(some guid)'.
Provide this tracing ID to customer support when you need assistance.

I've tried this in both my ASP.NET website and in my LINQPad, they both give the same error (with different GUIDs). I am trying to connect to the exact same server as my primary login, which can connect perfectly.

I've also checked sys.sysusers system view and readerUser is there as a login.

What could be the reason?


回答1:


After trying many combinations (and learning better about users, logins, and roles on SQL Azure) I've figured out the issue:

I was trying to login with readerUser, which is just a database user, and I should instead have logged in with the login instance, hence reader (as followed by the answer at the question that I've linked). I've tried logging in with reader and it worked perfectly: logging in, SELECTing anything I want, but not able to write/alter/delete anything.



来源:https://stackoverflow.com/questions/23964984/cannot-login-with-read-only-user-to-sql-azure-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!