Integrating with Azure SQL Server
Last updated
Was this helpful?
Last updated
Was this helpful?
Drivetrain uses Fivetran to integrate with Azure SQL Server. We connect to your Azure account directly using TLS. This guide covers the detailed steps for the integration process.
To connect Azure SQL Server to Drivetrain, you need:
SQL Server version 2012 or above
An Azure account with a DB Owner, SQL Server Contributor, or SQL Security Manager role
ALTER ANY USER permissions in your database server
Your database host's IP (e.g., 1.2.3.4
) or domain (e.g., your.server.com
)
Your database's port (usually 1433
)
Select the preferred authentication method, below are the details for both of the authentication methods.
Authenticate with Microsoft Entra ID (formerly Azure Active Directory)
Microsoft Entra ID allows you to authenticate Drivetrain using OAuth-style authentication. You can easily limit permissions and revoke Drivetrain's access at any time, while also not sharing any user or password credential information with Drivetrain.
Go to the Azure portal, and search Microsoft Entra ID on the search bar.
On the Microsoft Entra ID page, click the Properties button.
Find and copy your tenant ID and store it in a secure document.
In your Azure SQL database, create a user using the following command. Even though you don't share user or password information with Drivetrain, the database eventually requires a user to issue queries. The PRINCIPAL-NAME
must either match your Active Directory user's User Principal Name or be a Group Principal Name assigned to that user.
Authenticate with Username and Password
With this method, you provide Drivetrain with a username and associated password for a properly-configured user on the database. You'll create this user later in this setup guide.
On the Azure main page, select SQL databases.
Click on the SQL database that you want to connect to Drivetrain.
On the database overview page, find the server name and make a note of it in the same secure document.
Click Set server firewall.
If you're authenticating Drivetrain with a username and password, create a database user for Drivetrain's exclusive use.
Open a connection to your Azure SQL database.
Once you have created user for Drivetrain, grant it SELECT permissions for the database, schemas, tables or specific columns you want to sync. Below are sample snippets for every type of access:
Enable change tracking at database level
Enable CT for each table you want to integrate
Grant the Drivetrain user VIEW CHANGE TRACKING permission for each of the tables that have change tracking enabled:
IMPORTANT: You must have a properly configured Entra ID enabled within your Azure account to authenticate with Microsoft Entra ID (formerly Azure Active Directory). Follow Azure's to properly enable Entra ID Authentication on your Azure SQL Database. You must have an AD admin user role to authorize Drivetrain's access
Log in to the .
On the Firewall settings page, add a new firewall rule with a name as “Drivetrain Integration”. Use link to enter the IP for your database region. Click on Save
Note: Drivetrain connects to Azure Directly, for which you must have enabled TLS on your database. Follow Azure's to enable TLS on your database.
Add a for Drivetrain by running the following command. Replace <database
> with the name of your database, <username
> with the username of your choice, and <password
> with a password of your choice:
(Optional) For SQL Server for Linux, if you are using with enabled, to improve performance and reduce delays, you may want to grant the necessary permissions to the Drivetrain user by running the following command:
This grants the Drivetrain user access to server state information, minimizing the dependency on checkpoint timing and reducing update delays. See the troubleshooting page for details.
For incremental updates, we use change tracking mechanism. With this mechanism, Drivetrain copy only the rows that have changed since the last data sync so we don't have to copy the whole table every time. Learn more in this . Below are the instructions for this:
While we recommend seven days of change retention, you can set your retention period as low as one day. However, a shorter retention period increases the risk that your logs will expire in between syncs, triggering an
Database Host’s IP (for example, 1.2.3.4
) or Domain ()