Add Azure SQL Database CDC source to an eventstream
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.
Note
This source is not supported in the following regions of your workspace capacity: West US3, Switzerland West.
Prerequisites
- Access to a workspace in the Fabric capacity license mode (or) the Trial license mode 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. - If you don't have an eventstream, create an eventstream.
Note that you must not enable mirroring in your Azure SQL database.
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.
Run 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
Launch the Select a data source wizard
If you haven't added any source to your eventstream yet, select Use external source tile.
If you're adding the source to an already published eventstream, switch to Edit mode, select Add source on the ribbon, and then select External sources.
On the Select a data source page, search for and select Connect on the Azure SQL DB (CDC) tile.
Configure and connect to Azure SQL Database 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. It's in this form:
mysqlservername.database.windows.net
.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.
Note
The maximum number of sources and destinations for one eventstream is 11.
View updated eventstream
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: