cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

AppInsight for SQL setup permissions errors

On the SQL server I want to monitor via AppInsight, I am supposed to run the following script to setup permissions. So I Opened MSQLS Management Studio, connected to the database (Sharepoint 2010, SQL 2008) and clicked "New Query" pasted the script and hit Execute. Nothing I have tweeked or changed has improved the outcome, any suggestions?

USE master

GRANT VIEW SERVER STATE TO AppInsightUser

GRANT VIEW ANY DEFINITION TO AppInsightUser

EXEC sp_adduser @loginame = 'AppInsightUser' ,@name_in_

db = 'AppInsightUser'

GRANT EXECUTE ON xp_readerrorlog TO AppInsightUser

USE msdb

EXEC sp_adduser @loginame = 'AppInsightUser' ,@name_in_

db = 'AppInsightUser'

EXEC sp_addrolemember N'db_datareader',

N'AppInsightUser'

EXECUTE sp_MSforeachdb 'USE [?]; EXEC sp_adduser

@loginame = ''AppInsightUser'', @name_in_db =

''AppInsightUser'''

THE FIRST TWO LINES OF THE ERROR:

Msg 15151, Level 16, State 1, Line 2

Cannot find the login 'AppInsightUser', because it does not exist or you do not have permission.

0 Kudos
1 Reply
Product Manager
Product Manager

You must connect to the SQL database server as "sa" or equivalent to create this new user account. This script assumes you have adequate permissions to create a new user account and assign appropriate permissions. Running the SQL query is not required if you prefer to manually assign the appropriate permissions or use an "sa" or account with equivalent privileges.

0 Kudos