Follow these instructions to replicate your Azure SQL database to your destination via Fivetran.
To connect your SQL Server database to Fivetran, you need:
- SQL Server version 2012 or above
- Your database host’s IP (e.g.,
18.104.22.168) or domain (e.g.,
- Your database’s port (usually
Choose a connection method link
Decide whether to connect your SQL Server database directly or using an SSH tunnel.
Connect directly (TLS required)
IMPORTANT: You must have TLS enabled on your database to connect directly to Fivetran.
Fivetran connects directly to your database instance. This is the simplest and most secure connection method.
To connect directly, create a firewall rule to allow access to Fivetran’s IPs.
Connect using SSH
Fivetran connects to a separate server in your network that provides an SSH tunnel to your database. You must connect through SSH if your database is in an inaccessible subnet on a virtual network.
To connect using SSH, create a firewall rule to allow access to your SSH tunnel server’s IP address.
Fivetran’s data processing servers need access to your database server. You must configure the firewall.
Configure server firewalllink
Open the SQL database firewall settings in the Azure console.
Select SQL databases in the left menu, then select the SQL database that you want to replicate.
Click Set server firewall.
Add a new firewall rule
Add a new firewall rule and save. Use Fivetran’s IP if you are connecting directly or your SSH tunnel server’s IP address if you are connecting using SSH.
Enter host and port in setup formlink
In your Fivetran setup form, enter the host and port.
Server namein the Azure database dashboard overview.
Create a Fivetran userlink
Run the following command to add a container database user. Replace
<database> with the name of your database,
<username> with the username of your choice, and
<password> with a password of your choice:
USE; CREATE USER <username> WITH PASSWORD = '<password>';
Grant user permissionslink
Once you’ve created the Fivetran user, grant it SELECT permission for the database, schemas, tables, or specific columns you want Fivetran to sync. You can grant access to everything in a given database:
GRANT SELECT on DATABASE::to <username>;
or all tables in a given schema:
GRANT SELECT on SCHEMA::to <username>;
or a specific table:
GRANT SELECT ON. TO <username>;
or a set of specific columns in a table:
GRANT SELECT ON. ( , , ...) TO <username>;
or all but a set set of specific columns in a table:
GRANT SELECT ON. TO <username>; DENY SELECT ON . ( , , ...) TO <username>;
Enter user, password, and database in setup formlink
In your Fivetran setup form, enter your user, password, and database name.
- For the User, enter
<servername>is part of your Azure host URL:
- For the Password, enter the password you set when you created the Fivetran user.
- For the Database, enter the name of the database you want to replicate from.
Enable incremental updateslink
We use SQL Server’s built-in change tracking (CT) mechanism for incremental updates. When enabled, CT keeps a record of the table rows that have changed in a certain window of time (the default window is the most recent 2 days). This mechanism lets Fivetran copy only the rows that have changed since the last data sync so we don’t have to copy the whole table every time. To learn more about incremental updates, see our updating data documentation.
Enable change tracking at the database level:
ALTER DATABASESET CHANGE_TRACKING = ON;
Enable change tracking for each table you want to integrate:
ALTER TABLE. ENABLE CHANGE_TRACKING;
Grant the Fivetran user
VIEW CHANGE TRACKINGpermission for each of the tables that have change tracking enabled:
GRANT VIEW CHANGE TRACKING ON. TO <username>;
Change tracking needs to be enabled at this step before continuing.
Choose schema prefixlink
Each database from your source will be mapped to a schema in the destination by adding a prefix to the source database name. For example, if your source database names are “foo” and “bar” and if you choose the prefix “source1”, then you will get schemas “source1_foo” and “source1_bar” in the destination.
Fivetran performs the following tests to ensure that we can connect to your Azure SQL database and that it is properly configured:
- The Connecting to SSH Tunnel Test validates the SSH tunnel details you provided in the setup form. It then checks that we can connect to your database using the SSH Tunnel. (We skip this test if you aren’t connecting using SSH.)
- The Connecting to Host Test validates the database credentials you provided in the setup form. It then verifies that the database host is not private and checks that we can connect to the host.
- The Validating Certificate Test generates a pop-up window where you must choose which certificate you want Fivetran to use. It then validates that certificate and checks that we can connect to your database using TLS. (We skip this test if you aren’t connecting directly.)
- The Connecting to Database Test checks that we can access your database.
- The Checking Access to Schema Test checks that we have the correct permissions to access the schemas in your database. It then verifies that your database contains at least one table.
- The Validating Replication Config Test verifies that your database has an incremental update mechanism enabled (either CDC or CT).
NOTE: The tests may take a few minutes to finish running.