This article helps you connect your externally hosted database and assumes that you have already prepared your database to make it usable. More information on how to prepare your database is available on the Preparing your hosted database for Relational Data page.
For Emarsys to successfully access your database, it needs to be configured as follows:
- Grant the following permissions to the Emarsys user:
Add the following IP addresses to the relevant allowlist:
This connector is only designed for Microsoft hosted Azure SQL databases on the
.database.windows.net domain which uses the standard port
1433 if you are hosting your own Azure server then you should use the MS SQL connector instead.
Please note that Azure Synapse connections are not supported.
Setting up the connection
The first step in using Relational Data is to set up the connection between your database and Emarsys.
- In the Emarsys platform, go to Add-ons > Relational Data > Connections.
In your Azure SQL database, the following roles should be assigned to the Emarsys user:
- In the top right corner in Connections, click Create New Connection.
- Select Azure SQL.
- Configure your connection as follows:
- Connection Name: the reference you want to give to your connection, can be the same as the DB name.
This cannot contain spaces and should use underscores instead.
- Host: the host name of the database
- User name: the login name of the user you want to use for this connection
- Password: the password of the user you want to use for this connection
- Connection parameters (optional): the database parameters you want to use, leave empty to use the default parameters.
- When you finished adding all the necessary data, Test your connection.
- Click Save to create the connector you just set up.
Specifying the default schema in your Azure SQL database
Azure databases do not support JDBC parameters to specify the default schema.
Azure databases store the default schema on the user's table.
List tables and schemas with the following query:
SELECT table_schema, table_name FROM information_schema.tables
You can show the default schema for a specific user with this query:
SELECT default_schema_name FROM sys.database_principals WHERE name = 'YourUserName';