Azure SQL Server Configuration
3 min
Purpose
In Azure SQL Server, the goal is to create a login and user with minimal read privileges using Azure-specific roles like MS_ServerStateReader.
Grant Permission
CREATE LOGIN [ username ] WITH PASSWORD = ’password ’;
ALTER SERVER ROLE ## MS_ServerStateReader ## ADD MEMBER [ username ];
CREATE USER [ username ] FROM LOGIN [ username ];Testing Permission
Connect as [username] to the Azure SQL Server and execute:
SELECT * FROM sys . dm_os_windows_info ;If the query returns data, [username] can view the server state, indicating that permissions are set up properly.