#solved - New Azure SQL Instance Admin can't Grant Access to Users (SQL Insights Azure SQL)

1 messages · Page 1 of 1 (latest)

sonic copper
#

I created some brand new Azure SQL Instances (Tried with both an S3 and a GP_Gen5_2) instance. Right after creating them, I made a new user and tried to grant it permissions using this query from the SQL Insights setup instructions for Azure SQL https://learn.microsoft.com/en-us/azure/azure-sql/database/sql-insights-enable?view=azuresql

CREATE USER telegraf WITH PASSWORD = N'mystrongpassword'; 
GO 
GRANT VIEW DATABASE STATE TO telegraf; 
GO 

but I get this error back when I try it in SSMS and Azure Data Studio

Msg 4613, Level 16, State 1, Line 4
Grantor does not have GRANT permission.

Does anybody know why I can't grant permissions to that new user even though I'm the admin user? Are there any workarounds/steps that I missed to setting up that user and granting it view perms?

Enable SQL Insights (preview) in Azure Monitor

sonic copper
#

It seems like I was able to grant permission to the user by swapping the database from master to the current database, but it seems like SQL insights still can't access it.

Does anybdy know why? It seems like it has the right permissions and is able to connect (based on SQL insights error logs)

sonic copper
#

Solved this. Sorry roundabout question.

It started with trying to grant view to a new database user and failing (this turned out to be because I was using master instead of the current database in SSMS)

Then turned into a problem with SQL Insights where the telegraf agent seemed to not be able to connect due to permissions error (which should've been granted in the previous step)

Then I found that I had my Azure SQL Connection string wrong for the SQL Insights configuration. I was missing the database name in the Initial Catalog portion

XXXXXXXX.database.windows.net,1433;Initial Catalog=XXXXXXX

after the above steps, I got SQL Insights working. The problem wasn't with admin user granting rights.