Skip to content

Microsoft SQL Server is a relational database management system. Tenzir can read events from SQL Server and Azure SQL Database.

DatabaseTableTDSMicrosoft SQL Server1433/tcp

Use from_microsoft_sql to connect to SQL Server-compatible databases over the Tabular Data Stream (TDS) protocol. The operator can read a table, execute a custom SQL query, list table metadata, or poll a table for newly inserted rows.

Tenzir connects to SQL Server over the network via the host and port you specify in the operator. This means:

  • Network: Tenzir and SQL Server can run on the same machine or on different machines in the same network.
  • IPC: There is no direct inter-process communication (IPC) mechanism; all communication uses TDS.
  • Co-deployment: For best performance and security, deploy Tenzir and SQL Server in the same trusted network or use TLS for encrypted connections.

These examples assume that Tenzir can reach SQL Server on the network and that the database user has read access to the target database.

from_microsoft_sql show="tables",
host="sql.example.com",
user="tenzir_reader",
password=secret("sql-server-password"),
database="security",
tls=true
from_microsoft_sql table="dbo.events",
host="sql.example.com",
user="tenzir_reader",
password=secret("sql-server-password"),
database="security",
tls=true
from_microsoft_sql query=r"SELECT id, created_at, source, message
FROM dbo.events
WHERE severity >= 3",
host="sql.example.com",
user="tenzir_reader",
password=secret("sql-server-password"),
database="security",
tls=true
from_microsoft_sql table="dbo.events",
live=true,
tracking_column="id",
host="sql.example.com",
user="tenzir_reader",
password=secret("sql-server-password"),
database="security",
tls=true

Azure SQL Database accepts TDS connections on port 1433 and requires TLS. Use the server host name from Azure, usually in the form <server>.database.windows.net, and set tls=true.

from_microsoft_sql query="SELECT TOP 10 * FROM dbo.events",
host="example.database.windows.net",
port=1433,
user="tenzir_reader",
password=secret("azure-sql-password"),
database="security",
tls=true

The operator currently supports SQL authentication. Microsoft Entra authentication, managed identities, Windows authentication, and Kerberos are not supported.

Last updated: