Azure MS SQL
ON THIS PAGE
Azure MS SQL Database is an intelligent, scalable, and relational database service built for the cloud. It can automate your database management and maintenance, including routine updates, backups, and security, enabling you to focus on working with your data.
You can ingest data from your Azure MS SQL database using Hevo Pipelines and replicate it to a Destination of your choice.
Prerequisites
-
The MS SQL Server version is 2008 or higher.
-
CHANGE TRACKING and ALTER DATABASE privileges are granted, if Pipeline mode is Change Tracking.
-
SELECT and VIEW CHANGE TRACKING privileges are granted to the database user.
-
Database hostname and port number of the Source instance are available.
Perform the following steps to configure your Azure MS SQL Source:
Create a Geo-Replication Database (Optional)
Geo-Replication is an Azure SQL database feature that allows you to create a readable secondary database in the same region or different regions.
Note: Creation of geo-replication database incurs additional costs.
To use an existing, active geo-replication database or connect Hevo to your master database, skip to Whitelist Hevo’s IP Addresses section.
To create a geo-replication database:
-
Log in to the Azure Portal.
-
Under Resources, select the database for which you want to create a geo-replication database.
-
In the left navigation pane, under Settings, click Geo-Replication.
-
Under Target regions, select your target region.
-
In the Create secondary page, specify your Target server, the Pricing tier, and then, click OK to create a secondary database.
A notification is displayed to confirm that the geo-replication database was created successfully.
Whitelist Hevo’s IP Addresses
You need to whitelist the Hevo IP addresses for your region to enable Hevo to connect to your Azure SQL database. You can do this by creating firewall rules in your Microsoft Azure database settings as follows:
-
Access your Azure MS SQL instance.
-
Under Resources, select the database you want to synchronize with Hevo.
-
In the right pane, click the Set server firewall tab to open the Firewall settings.
-
Create a firewall rule:
-
Specify a Rule name.
-
Specify Hevo’s IP addresses in the Start IP and End IP fields as per your region.
Note: As Hevo has specific IP addresses and not a range, the value in Start IP and End IP fields is the same.
-
Click Save.
-
Repeat this step to add the IP address for each applicable Hevo region.
-
Enable Change Tracking
The Change Tracking mechanism captures changes made to a database. In order to enable, or disable change tracking, the database user must have the ALTER DATABASE
privilege.
To enable change tracking, connect your Azure SQL Database in your SQL Client tool, and enter these commands:
-
Enable change tracking at the database level:
ALTER DATABASE [<database>] ; SET CHANGE_TRACKING = ON;
-
Enable change tracking for each table you want to integrate:
ALTER TABLE [<schema>].[<table>] ; ENABLE CHANGE_TRACKING;
Create a Database User and Grant Privileges
1. Create a database user (optional)
To create a database user, open your Azure MS SQL database in your SQL client tool and enter the following commands:
USE [<database>]; # <database> is the database name
CREATE USER hevo WITH PASSWORD = '<password>';
This creates a contained database user who grants access to the database user on an individual database level instead of the master database level.
2. Grant privileges to the user
The database user specified in the Hevo Pipeline must have the following global privileges:
-
SELECT
-
VIEW CHANGE TRACKING
(If Pipeline Mode is Change Tracking)
To assign these privileges, connect your Azure SQL Database in your SQL Client tool, and enter these commands:
-
Grant
SELECT
privilege:GRANT SELECT ON <schema_name>.<table_name> TO <username>;
-
Grant
VIEW CHANGE TRACKING
privilege, if Pipeline Mode is Change Tracking:GRANT VIEW CHANGE TRACKING ON <schema_name>.<table_name> TO <username>;
Retrieve the Hostname and Port Number (Optional)
Note: The Azure MS SQL hostnames start with your database name and end with windows.net.
For example:
Host : mssql.database.windows.net
Port : 1433
Refer to the steps below to gather the configuration details required to create your Hevo Pipeline:
To retrieve the hostname:
-
Log in to the Microsoft Azure Portal.
-
Under Recent resources, select your SQL database.
-
In the Essentials panel, locate the Server name. Use this as the hostname while creating your Pipeline.
The default port value is 1433.
Limitations
- Hevo does not support Azure CDC for replication.
Revision History
Refer to the following table for the list of key updates made to the page:
Date | Release | Description of Change |
---|---|---|
09-Mar-2021 | 1.58 | Replaced references to Logical Replication with Change Tracking as Change Tracking is a distinct Pipeline mode for SQL Server Source types. |
22-Feb-2021 | 1.57 | Added sections: - Create a Geo-replication Database - Create a User and Grant Privileges - Retrieve the Hostname and Port Number |