Add Azure SQL Database CDC source to an eventstream (preview)
This article shows you how to add an Azure SQL Database Change Data Capture (CDC) source to an eventstream.
The Azure SQL Database CDC source connector for Microsoft Fabric event streams allows you to capture a snapshot of the current data in an Azure SQL database. The connector then monitors and records any future row-level changes to this data. Once the changes are captured in the eventstream, you can process this CDC data in real-time and send it to different destinations within Fabric for further processing or analysis.
Important
Enhanced capabilities of Fabric event streams are currently in preview.
Note
This source is not supported in the following regions of your workspace capacity: West US3, Switzerland West.
Prerequisites
- Access to the Fabric premium workspace with Contributor or higher permissions.
- A running Azure SQL server with an Azure SQL database.
- Your Azure SQL database must be publicly accessible and not be behind a firewall or secured in a virtual network.
- Enabled CDC in your Azure SQL database by running the stored procedure
sys.sp_cdc_enable_db
. For details, see Enable and disable change data capture.
Note that you must not enable mirroring in your Azure SQL database.
Note
The maximum number of sources and destinations for one eventstream is 11.
Enable CDC in your Azure SQL Database
Go to the Azure portal, open your Azure SQL database, and select Query editor. Choose an authentication method to log in.
Execute the following SQL commands to enable CDC in your database:
-- Enable Database for CDC EXEC sys.sp_cdc_enable_db; -- Enable CDC for a table using a gating role option EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'MyTable', @role_name = NULL GO
After the query executes successfully, you have enabled CDC in your Azure SQL database.
Add Azure SQL Database CDC as a source
Select Eventstream to create a new eventstream. Make sure the Enhanced Capabilities (preview) option is enabled.
On the next screen, select Add external source.
Configure and connect to Azure SQL Database CDC
On the Select a data source screen, select Azure SQL DB (CDC).
On the Connect page, select New connection.
In the Connection settings section, enter the following values for your Azure SQL database:
Server: Enter the Azure SQL server name from the Azure portal.
Database: Enter the Azure SQL database name from the Azure portal.
Scroll down, and in the Connection credentials section, follow these steps.
For Connection name, enter a name for the connection.
For Authentication kind, select Basic.
Note
Currently, Fabric event streams supports only Basic authentication.
Enter Username and Password for the database.
Select Connect.
Now, on the Connect page, enter the following information:
- Select All tables or enter the table names separated by commas, such as: dbo.table1, dbo.table2
- For Port, the default value is 1433 and cannot be modified.
Select Next.
On the Review and create screen, review the summary, and then select Add.
You can see the Azure SQL Database (CDC) source added to your eventstream in Edit mode.
To implement this newly added Azure SQL Database CDC source, select Publish. After you complete these steps, your Azure SQL Database CDC source is available for visualization in the Live view.
Related content
Other connectors: