Q:

Azure SQL Invalid object name 'sys.server_role_members'

I am getting error "Invalid object name 'sys.server_role_members'" 
when running the following query in SQL Server 2014:
SELECT sr.name,sp.name 
FROM sys.server_role_members srm
inner join sys.server_principals as sp ON 
srm.member_principal_id = sp.principal_id
inner join sys.server_principals as sr ON
srm.role_principal_id = sr.principal_id

I am using Azure SQL and connecting to it via SQL Server 2014 developer version.  I checked under system views and I do not see neither sys.server_role_members nor sys.server_principals system views.  Does anyone know why those views are not showing up in Azure? 

A:

Server-level roles and logins are handled a bit differently in Azure SQL Database than they are in SQL Server:

There two server-level security roles in the master database: loginmanager and dbmanager. 
Instead of sys.server_principals, you use sys.sql_logins in master. 

I'd encourage you to take a look at Managing Databases and Logins in Azure SQL Database for details on the differences between Azure SQL Database and SQL Server for server-level administration.  Note that in most cases, you'll get better performance if you use contained database users with Azure SQL Database, since these users can authenticate directly at the user database and avoid the extra round-trip to master required by logins. 

A:

Using [sys].[database_permissions],[sys].[objects] and [sys].[database_principals] 
instead of sys.server_role_members and sys.server_principals worked for me

