Today, I worked on a service request where our customer asked is it possible to define a custom SQL role to someone logging in via Azure Active Directory who is in the Admins group?
In Azure SQL Database we have two administrator users: SQL Logins and Azure Active Directory that could be a AAD User or AAD Group.
However, we couldn't see this user in the security list of the database and we cannot add this administrator user as a custom SQL role.
In this situation, I noticed that running SELECT USER_NAME(), this command returns dbo and, at least, you could identify this type of group.
For giving more context in this situation, the idea is to use Row Level Security to an specific group and specific Admin Users, for example:
ALTER FUNCTION [fn_access]()
RETURN SELECT 1 AS fn_accessResult
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.