Azure SQL Setup

This article is for general guidance. Always work with your DBA when setting up a production database. If you have any questions, contact Senzing Support . Support is 100% FREE!
When upgrading from Senzing v3 to Senzing v4, there are changes made to the entity repository database schema. See Upgrading the Senzing Repository Schema To V4

Prerequisites

  • An Azure SQL Database or Azure SQL Managed Instance

  • A <username>, <password>, <server> (for example, myserver.database.windows.net), and <database> from the DBA that has select, delete, update, and truncate access

  • ODBC Driver 17+ for SQL Server installed

  • Ubuntu/Debian: Install the Microsoft ODBC Driver for SQL Server . Use the msodbcsql17 or msodbcsql18 package.
  • Red Hat/Amazon Linux: Same Microsoft repository, msodbcsql17 or msodbcsql18 package.
  • Windows: Included with SQL Server tools, or install separately from Microsoft.

Add the Senzing schema

If applicable, the DBA should set up the database schema. If you have any questions, contact Senzing Support . Support is 100% FREE!

Using sqlcmd or Azure Data Studio, connect to the Azure SQL Database and execute the schema creation script:

sqlcmd -S <server>.database.windows.net -d <database> -U <username> -P <password>
:r <senzing_project_path>/resources/schema/szcore-schema-mssql-create.sql
GO
<senzing_project_path> refers to the path specified with the /opt/senzing/er/bin/sz_create_project command when creating a project.

Verify the tables were created:

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_NAME
GO

Configure the CONNECTION string

Edit the SENZING_ENGINE_CONFIGURATION_JSON environment variable or sz_engine_config.ini file :

Standard password authentication

Edit the new CONNECTION mssql://<username>:<password>@<server>:1433/<database>?encrypt=yes entry where:

1433 is the default Azure SQL port number. Change this if the port value differs. encrypt=yes is required for Azure SQL.
Parameter Description
<username> Azure SQL username
<password> Password for the above username
<server> Azure SQL server (for example, myserver.database.windows.net)
1433 Port number of the Azure SQL Server
<database> Database name
encrypt=yes Required. Enables TLS encryption for Azure SQL.

Azure Entra ID authentication

Azure SQL supports Entra ID (formerly Azure Active Directory) authentication methods. These are configured entirely through the connection string. No odbc.ini changes are required.

Entra ID password authentication

The @ in the Entra ID username must be URL-encoded as %40 in the connection string URI.
mssql://<user>%40<domain>:<password>@<server>.database.windows.net:1433/<database>?authentication=ActiveDirectoryPassword&encrypt=yes
Parameter Description
<user>%40<domain> Entra ID user with @ encoded (for example, admin%40contoso.com)
<password> Entra ID password
authentication=ActiveDirectoryPassword Selects Entra ID password authentication

Managed Identity (user-assigned)

mssql://<client-id>:dummy@<server>.database.windows.net:1433/<database>?authentication=ActiveDirectoryMsi&encrypt=yes
The password field (dummy) is required by the URI format but is ignored by the ODBC driver when using Managed Identity authentication.
Parameter Description
<client-id> Client ID of the user-assigned managed identity
authentication=ActiveDirectoryMsi Selects Managed Identity authentication

Additional connection parameters

Parameter Description
encrypt=yes Enable TLS encryption (required for Azure SQL)
trustServerCertificate=yes Skip certificate validation (development/testing only)
driver=<drivername> Specify ODBC driver name if auto-detection fails

Update database with the Senzing ER configuration

A Senzing instance is configured with a Senzing Entity Resolution configuration. On a fresh installation this configuration needs to be registered in the Senzing database.

See Updating Database with Senzing ER Configuration

If you have any questions, contact Senzing Support. Support is 100% FREE!