Search This Blog

How to fix 'dbo' user should not be used for normal service operation vulnerability in SQL Azure Database.

  • Need to create a new login and new user with the lowest possible priveledges.
  • New login can be created in the 'master' database only. As of now, there is no way to change the database to 'master' from Azure portal.
  • Use 'SQL Server Management Studio' using the admin user created at the time of creating a database.
  • user master; 
    • CREATE LOGIN appusr WITH password='xxxxxxx';
  • use yourdb; 
    • CREATE USER appusr FOR LOGIN appusr; 
    • EXEC sp_addrolemember N'db_datareader', N'appusr'; 
    • EXEC sp_addrolemember N'db_datawriter', N'appusr'; 
    • GRANT EXECUTE TO [appusr];