Prepare to run the Microsoft SQL Server collector
Configure authentication and permissions before running the collector.
Before you begin
Role required: admin
About this task
The collector supports three authentication methods for Microsoft SQL Server. All methods require SELECT ON DATABASE permission for metadata access. VIEW DEFINITION permission is required for column-level lineage harvesting.
Procedure
Select an authentication method and complete the corresponding setup task.
- Username and password authentication - See Set up username and password authentication
- NTLM authentication- See Set up NTLM authentication
- Microsoft Entra Service Principal authentication - See Set up Service Principal authentication
- Grant SQLAgentReaderRole permissions to harvest Agent job metadata.
See Set up permissions for harvesting SQL Server Agent jobs.
Parent Topic:Microsoft SQL Server metadata collector
Set up NTLM authentication
Create a service account and grant permissions for NTLM authentication.
Before you begin
Role required: admin
The computer running the collector must be attached to the Active Directory domain.
About this task
Configure NTLM authentication using an Active Directory service account with the minimum required permissions for metadata harvesting.
Procedure
Create a service account in Active Directory.
Grant SELECT ON DATABASE permission.
This permission allows the collector to harvest catalog data assets such as tables, views, and columns.
GRANT SELECT ON DATABASE :: <databaseName> TO <user>;Replace
<databaseName>and<user>with your values.Grant VIEW DEFINITION permission.
This permission enables column-level lineage harvesting from views.
GRANT VIEW DEFINITION ON DATABASE :: <databaseName> TO <user>;Replace
<databaseName>and<user>with your values.Assign the public role for table size information.
This allows the collector to run the sp_spaceused stored procedure.
See the sp_spaceused documentation for details.
What to do next
When configuring the collector, set these JDBC properties: integratedSecurity=true, authenticationScheme=NTLM
Set up username and password authentication for SQL Server collector
Create a SQL Server login and grant permissions for username and password authentication.
Before you begin
Role required: admin
About this task
Configure a SQL Server login with the minimum required permissions for metadata harvesting.
Procedure
Create a login with password.
CREATE LOGIN <loginName> WITH PASSWORD = '<password>';Replace
<loginName>and<password>with your values.Create a user for the login.
CREATE USER <user> FOR LOGIN <loginName>;Replace
<user>and<loginNam>with your values.Grant SELECT ON DATABASE permission.
This permission allows the collector to harvest catalog data assets such as tables, views, and columns.
GRANT SELECT ON DATABASE :: <databaseName> TO <user>;Replace
<databaseName>and<user>with your values.Grant VIEW DEFINITION permission.
This permission enables column-level lineage harvesting from views.
GRANT VIEW DEFINITION ON DATABASE :: <databaseName> TO <user>;Replace
<databaseName>and<user>with your values.: Grant execute permission for sp_spaceused.
This permission allows the collector to harvest table size information.
GRANT EXECUTE ON sp_spaceused TO <user>;Replace
<user>with your value.
What to do next
See the Microsoft SQL Server permissions documentation for more information about database permissions.
Set up Service Principal authentication
Register an Azure application and grant permissions for Service Principal authentication.
Before you begin
Role required: admin
About this task
Configure Microsoft Entra Service Principal authentication by registering an Azure application and granting database access.
Procedure
Register a new application in Azure.
Navigate to Azure Portal > App Registrations.
Select New Registration.
Enter the application name.
Example: MySQLServerApplication.
For Supported account types, select Accounts in this organizational directory only.
Select Register.
Create a client secret.
On the application page, select Certificates and Secrets > Client secrets.
Select New client secret.
Add a description and set the expiration date.
Select Add.
Copy the secret value.
Grant the service principal access to SQL Server.
In Azure Portal, navigate to your SQL Server instance.
Select Access control (IAM) > Add Role Assignment.
Select Reader under the Job function roles tab.
Select Next.
For Assign access to, verify that User, group or service principal is selected.
Select Select members.
Search for your registered application name and select it.
Select Review + assign.
Grant the service principal access to the database.
Connect to SQL Server using SQL Server Management Studio.
Run this command:
CREATE USER [<service-principal>] FROM EXTERNAL PROVIDER;Replace
<service-principal>with your service principal name.Grant SELECT ON DATABASE permission.
GRANT SELECT ON DATABASE :: <databaseName> TO [<service-principal>];Replace
<databaseName>and<service-principal>with your values.Grant VIEW DEFINITION permission.
GRANT VIEW DEFINITION ON DATABASE :: <databaseName> TO [<service-principal>];Replace
<databaseName>and<service-principal>with your values.
What to do next
See the Microsoft Entra authentication documentation for more information.
Set up permissions for harvesting SQL Server Agent jobs
Grant SQLAgentReaderRole permissions to harvest Agent job metadata.
Before you begin
Role required: sysadmin
About this task
To harvest SQL Server Agent job metadata, assign the SQLAgentReaderRole in the msdb system database.
Procedure
Locate the user that is used for running the collector.
Grant SQLAgentReaderRole to the user.
USE msdb; EXEC sp_addrolemember 'SQLAgentReaderRole', '<username>';Replace
<username>with your user name.