Feature Engine
Integrate with Microsoft SQL Server data sources.
Chalk supports Microsoft SQL Server
and Azure SQL Database
as a SQL source.
You can configure the Microsoft SQL Server-specific
options using the MSSQLSource init args,
or configure the source through your dashboard, and
reference the source in your code.
For local development, you’ll need to install ODBC drivers:
brew install unixodbcsudo apt-get install unixodbc unixodbc-devsudo yum install unixODBC unixODBC-develThen install the Python package: pip install 'chalkpy[mssql]'
Production deployments on Chalk handle ODBC drivers automatically.
On the dashboard, you can plug in the configuration for your Microsoft SQL Server database:
Add a Microsoft SQL Server integration. These parameters will also be available as environment variables.

Chalk supports three authentication methods:
SQL Authentication - Traditional username and password authentication
Azure AD Managed Identity - When running in Azure (such as in AKS or Azure VMs), Chalk can automatically authenticate using Managed Identity. Simply omit authentication credentials when configuring your source.
Azure AD Service Principal - For authentication using an Azure AD application, provide client_id, client_secret, and tenant_id.
After configuring your Microsoft SQL Server integration in the dashboard, define your data sources in Python:
from chalk.sql import MSSQLSource
risk_source = MSSQLSource(name="risk")
marketing_source = MSSQLSource(name="marketing")Then reference them in SQL file resolvers using the name parameter. For example, to query from the risk source:
-- type: online
-- resolves: User
-- source: risk
SELECT id, credit_score FROM usersAnd to query from the marketing source:
-- type: online
-- resolves: User
-- source: marketing
SELECT id, email, campaign_status FROM usersNamed integrations inject environment variables with the standard names prefixed by the integration name. For example, if your integration is called risk, then the variable MSSQL_HOST will be injected as risk_MSSQL_HOST.