0

I am asked to provide access to VIEW DATABASE STATE in the master DB of an Azure SQL Server instance (Premium P6) to an external user (vendor) in order some investigation to be done.

When run "grant VIEW DATABASE STATE TO " it returns "Grantor does not have GRANT permission." When run "grant VIEW SERVER STATE TO " it returns "Securable class 'server' not supported in the server scope in this version of SQL Server".

From what I read in some articles it seems that there is no VIEW DATABASE STATE in the master DB, it is only available in the user's databases, am I right?

As I am new in this area (have more experience with Oracle and almost nothing with Azure SQL Server) can someone tell is it even possible VIEW DATABASE STATE to be granted over master DB? And is really VIEW SERVER STATE is not supported or I am doing something wrong?

0

1 Answer 1

0

Azure SQL Database can be a little confusing on how to provision permissions, IMO.

From what I read in some articles it seems that there is no VIEW DATABASE STATE in the master DB, it is only available in the user's databases, am I right?

Yes, I believe this to be pretty much true, that in Azure SQL Database, it is not permitted to grant such a permission to the master database. Instead, the correct thing to do is apply it to the user database(s) instead that you want DMV and diagnostic information to be available for. That seems to be what is discussed in this GitHub thread:

...you are not able to grant this permission to users in the master database...

And

On Premium Tiers, you would be able to grant VIEW DATABASE STATE permissions to the contained user in the scoped database, and run server or database level scoped DMVs on that database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.