Installation
Install the SQL Server connector:Authentication Methods
SQL Server supports multiple authentication methods:- SQL Login (username/password)
- DefaultAzureCredential (Azure managed identity)
- Access Token (Azure AD access token)
- Entra ID User/Password (Azure AD credentials)
- Service Principal Secret (Azure AD application)
Configuration
SQL Login (Standard Authentication)
Azure DefaultAzureCredential
Use Azure managed identity for authentication:connection.yaml
Access Token
connection.yaml
Entra ID User/Password
connection.yaml
Service Principal Secret
connection.yaml
Configuration Parameters
Server hostname or IP address
Server port
Database name to connect to
Authentication method:
default, azure-active-directory-default, azure-active-directory-access-token, azure-active-directory-password, or azure-active-directory-service-principal-secretEnable encryption. Should be true when using Azure SQL Database
Trust self-signed certificates. Should be true for local dev with self-signed certificates
Connection timeout in milliseconds
Request timeout in milliseconds
SQL Login Parameters
SQL Server username
SQL Server password
Azure Access Token Parameters
Azure AD access token
Entra ID User/Password Parameters
Azure AD username
Azure AD password
Azure AD application client ID
Azure AD tenant ID
Service Principal Parameters
Service principal client ID
Service principal client secret
Azure AD tenant ID
Features
Type Mapping
SQL Server types are mapped to Evidence types:- Numbers: INT, TINYINT, BIGINT, SMALLINT, FLOAT, REAL, DECIMAL, NUMERIC, MONEY, SMALLMONEY
- Strings: VARCHAR, NVARCHAR, CHAR, NCHAR, TEXT, NTEXT, XML
- Dates: DATETIME, SMALLDATETIME, DATE, DATETIME2, DATETIMEOFFSET
- Booleans: BIT
Streaming Results
The connector streams query results in batches (default 100,000 rows) for memory-efficient processing.Row Count Estimation
The connector estimates total row counts for queries to help optimize rendering and pagination.Example Query
Create a SQL file in your Evidence project:queries/sales_analysis.sql
Azure SQL Database
Connection Example
connection.yaml
Firewall Rules
Ensure your IP address is allowed in Azure SQL firewall rules:- Go to Azure Portal → SQL Database → Your Database
- Click “Set server firewall”
- Add your Evidence instance IP or IP range
Managed Identity
For Azure-hosted Evidence instances, use managed identity:connection.yaml
Performance Optimization
Use Proper Indexes
Avoid SELECT *
Specify only needed columns:Use NOLOCK for Read-Only Queries
For reporting queries on high-traffic tables:Troubleshooting
Connection timeout errors
Connection timeout errors
- Verify server hostname and port
- Check firewall rules (especially for Azure SQL)
- Increase
connection_timeoutfor slow networks - Ensure SQL Server is running and accepting connections
SSL/TLS errors
SSL/TLS errors
For local development with self-signed certificates:For Azure SQL Database:
Azure authentication errors
Azure authentication errors
- Verify tenant ID and client ID are correct
- Ensure the service principal/app has permissions on the database
- For managed identity, ensure it’s assigned to the Azure resource
- Check that the database user exists:
Login failed errors
Login failed errors
- Verify username and password are correct
- Check that SQL Server authentication is enabled (not Windows-only)
- Ensure the user has access to the specified database:
Performance issues
Performance issues
- Add indexes to commonly filtered columns
- Use query execution plans to identify bottlenecks
- Consider using columnstore indexes for analytical queries
- Update statistics:
UPDATE STATISTICS table_name