about permission, view server performance state denied in paas server database

Naga Durga Devi Kannuri - Admin 20 Reputation points
2025-05-07T13:17:12.07+00:00

i have read write permission to particular database in paas server, but while user run the update statement, it was throwing an error, like view server performance state denied, but when i try to give server performance state permission, throwing an error like this permission cant run in server, it is telling that cant execute view server performance state permission state in paas contained database, then what is the solution for this. kindly give resolution steps -by user should update the data

SQL Server on Azure Virtual Machines
{count} votes

1 answer

Sort by: Most helpful
  1. PratikLad 1,125 Reputation points Microsoft External Staff Moderator
    2025-05-12T17:09:05.7+00:00

    Hi Naga Durga Devi Kannuri - AdminTo be able to query the sys.dm_os_sys_info DMV the user that you are using to get connected to the server requires VIEW SERVER STATE permission on the server or have administrative privileges on the SQL server.

    To create a new login in Azure SQL Database with administrative authentication, I executed the following script in the master database:

    
    create login1 with password = '<password>'
    
    

    Create a user with above login in my required database and assigned role to the user.

    
    USE [database]
    
    GO
    
    CREATE USER <user> FOR LOGIN <login>
    
    GO
    
    ALTER ROLE db_owner ADD MEMBER <user>
    
    GO
    
    

    Login into master database with admin authentication and add below role to the new login

    
    ALTER SERVER ROLE ##MS_ServerStateReader##
    
      ADD MEMBER login1;  
    
    GO
    
    

    And open up a new query window as an admin account privileges and enter the following:

    
    GRANT VIEW SERVER STATE TO [login]
    
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.