visual studio 2013 - Creating Azure SQL Database login/user using Azure AD -
i have 2 users (name@company.com) in our azure ad have been granted owner permissions azure server via azure portal.
first, possible create login links/pulls azure ad these login credentials? i've searched , haven't found specific answer this, though suspicion no.
second, have created logins/users same database, however, while access server fine, access database denied. have granted connect logins executed sp_addrolemember datareader each database. in double checking work, had referenced several examples show same syntax i'm using azure logins/users, , yet access still denied.
any appreciated.
steve.
code:
create login [login_name] password = n'password'
create user [user_name] login [login_name] default_schema = dbo go grant connect [user_name]
exec sp_addrolemember 'db_datareader', 'user_name'
first, possible create login links/pulls azure ad these login credentials? i've searched , haven't found specific answer this, though suspicion no.
no. in azure sql database can use users , logins created in azure sql database - sql login.
second, have created logins/users same database, however, while access server fine, access database denied. have granted connect logins executed sp_addrolemember datareader each database. in double checking work, had referenced several examples show same syntax i'm using azure logins/users, , yet access still denied.
logins
should created in master db, while users
, grants
, sp_addrolemember
should executed in context of targeted db. if executed sp_addrolemember in master database, user not have access targeted db.
also, important, when try connect db new logins (and please note login db use login
not user
), have explicitly select database new user has access!
my wild guess have executed create user
, grant
and sp_addrolemember
in context of master database. these users have access master database. cannot grant explicit grants other database when in context of master.
Comments
Post a Comment