Azure SQL Database
Datafly Signal writes first-party events into an Azure SQL Database table over the SQL Server wire protocol, with TLS encryption required.
Prerequisites
Before configuring Azure SQL Database in Signal, you need an Azure account with an Azure SQL server, a database, a target table, and firewall rules configured to allow Signal access.
Create an Azure Account
If you don’t already have one, sign up at azure.microsoft.com.
Create an Azure SQL Server
- In the Azure portal, search for SQL servers and click Create.
- Select your Subscription and Resource group.
- Enter a Server name (e.g.
datafly-sql). The full hostname will bedatafly-sql.database.windows.net. - Select a Location close to your Signal deployment.
- Set the Server admin login and Password.
- Click Review + Create > Create.
Create a Database
- In the Azure portal, search for SQL databases and click Create.
- Select your server from the previous step.
- Enter a Database name (e.g.
analytics). - Choose a Compute + storage tier:
- Basic or Standard for low-volume workloads.
- General Purpose (vCore) for production workloads.
- Click Review + Create > Create.
Configure Firewall Rules
- Open your Azure SQL server in the portal.
- Go to Security > Networking.
- Under Firewall rules, add the IP addresses of your Signal deployment.
- Optionally enable Allow Azure services and resources to access this server if Signal runs within Azure.
- Click Save.
Never set the firewall to allow all IP addresses (0.0.0.0 to 255.255.255.255) in production. Restrict access to only the IP addresses of your Signal infrastructure.
Create a Table
Connect to the database using Azure Data Studio, SSMS, or the Azure portal Query Editor:
CREATE TABLE dbo.events (
event_id NVARCHAR(64) NOT NULL PRIMARY KEY,
type NVARCHAR(20),
event NVARCHAR(256),
anonymous_id NVARCHAR(64),
user_id NVARCHAR(256),
timestamp DATETIME2,
received_at DATETIME2,
sent_at DATETIME2,
context NVARCHAR(MAX),
properties NVARCHAR(MAX),
traits NVARCHAR(MAX),
source_id NVARCHAR(64),
integration_id NVARCHAR(64)
);
CREATE INDEX IX_events_timestamp ON dbo.events (timestamp DESC);Create a Database User for Signal
Create a dedicated user with limited privileges:
CREATE LOGIN datafly_signal WITH PASSWORD = 'your_secure_password';
CREATE USER datafly_signal FOR LOGIN datafly_signal;
GRANT INSERT ON dbo.events TO datafly_signal;Configuration
| Field | Type | Required | Description |
|---|---|---|---|
server | string | Yes | The Azure SQL server hostname (e.g. myserver.database.windows.net). |
port | string | No | TCP port. Defaults to 1433. |
database | string | Yes | The target database name. |
schema_name | string | No | The schema to write to. Defaults to dbo. |
table_name | string | Yes | The target table name to insert rows into. |
username | string | Yes | The database username for authentication. |
password | secret | Yes | The database password for authentication. |
encrypt | string | Yes | Set to true — Azure SQL requires TLS. |
Signal Setup
Quick Setup
- Navigate to Integrations in the sidebar.
- Open the Integration Library tab.
- Find Azure SQL Database or filter by Database.
- Click Install, select a variant if available, and fill in the required fields.
- Click Install Integration to create the integration with a ready-to-use default blueprint.
API Setup
curl -X POST http://localhost:8084/v1/admin/integration-catalog/azure_sql/install \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Azure SQL Database",
"variant": "default",
"config": {
"server": "datafly-sql.database.windows.net",
"port": "1433",
"database": "analytics",
"schema_name": "dbo",
"table_name": "events",
"username": "datafly_signal",
"password": "your_secure_password",
"encrypt": "true"
},
"delivery_mode": "server_side"
}'Schema
Signal writes the standard event envelope. The recommended table definition:
| Column | Azure SQL type | Notes |
|---|---|---|
event_id | NVARCHAR(64) NOT NULL PRIMARY KEY | Unique per event. |
type | NVARCHAR(20) | Event type. |
event | NVARCHAR(256) | Event name. |
anonymous_id | NVARCHAR(64) | First-party visitor identifier. |
user_id | NVARCHAR(256) | Logged-in user identifier (nullable). |
timestamp | DATETIME2 | Client event time. |
received_at | DATETIME2 | Time Signal received the event. |
sent_at | DATETIME2 | Time the row was delivered. |
context | NVARCHAR(MAX) | JSON document — page, device, consent metadata. |
properties | NVARCHAR(MAX) | JSON document — custom event properties. |
traits | NVARCHAR(MAX) | JSON document — user traits. |
source_id | NVARCHAR(64) | Pipeline source identifier. |
integration_id | NVARCHAR(64) | Signal integration identifier. |
Query JSON columns with JSON_VALUE(), JSON_QUERY(), and OPENJSON().
Consent
Azure SQL is a first-party destination under your control. The default blueprint forwards all events. Apply consent filtering via pipeline transforms or downstream views on context if your governance requires it.
Testing
- Enable the integration in Signal and trigger a test event on your website.
- Connect to the Azure SQL database and query the target table:
SELECT TOP 10 * FROM dbo.events ORDER BY timestamp DESC;- Verify that event rows are appearing with correct data.
- In Signal, check the Live Events view to confirm delivery status shows as successful.
Troubleshooting
| Problem | Solution |
|---|---|
| Events not appearing in the table | Verify the server, database, and table name are correct. |
| Connection refused / timeout | Check the firewall rules on the Azure SQL server. Add Signal’s IP addresses under Networking > Firewall rules. |
Login failed for user | The username or password is incorrect. Verify the credentials. Check that the login exists at the server level and the user is mapped to the database. |
INSERT permission denied | The database user lacks INSERT permission on the table. Run GRANT INSERT ON dbo.events TO datafly_signal;. |
Invalid object name | The table does not exist or the user lacks access. Verify the table name and schema. |
| SSL/TLS errors | Azure SQL requires encrypted connections. Ensure your Signal deployment supports TLS 1.2+. |
| DTU/vCore throttling | The database tier may be too small. Monitor DTU/vCore usage in the Azure portal and scale up if needed. |
Visit Azure SQL Database documentation for full T-SQL reference, performance tuning, and scaling guides.