Migrating Data from Azure Synapse Analytics¶
This page covers Azure Synapse Analytics-specific setup for Data migration. For workflow and Worker field definitions, see Data migration configuration reference.
Synapse support covers both pool types:
- Dedicated SQL pool (
azure_synapse): the default and primary target. - Serverless SQL pool (
azure_synapse_serverless): supported where your Worker environment allows it.
Both pool types share the same connection block and driver. Set the pool type with pool_type in Worker TOML, and set source_platform in the workflow to the value that matches your pool.
Prerequisites¶
- Microsoft ODBC Driver 18 for SQL Server on each Worker host. Synapse uses the same ODBC driver family as SQL Server. Override the driver name with
odbc_driverin TOML if needed. - Azure Blob Storage and pre-created Synapse objects when using CETAS extraction: a
DATABASE SCOPED CREDENTIAL, anEXTERNAL DATA SOURCE, and anEXTERNAL FILE FORMAT(Parquet) on Synapse, plus a Snowflake external stage pointing at the same container. See Using CETAS extraction.
Connectivity and extraction strategies¶
Synapse supports three extraction strategies:
| Strategy | When to use | Worker requirements |
|---|---|---|
regular (default) | Worker pulls partitioned result sets over ODBC and writes Parquet to the internal migration stage. Use for most tables. | Standard [connections.source.azure_synapse] TOML only |
cet_as (CETAS, recommended for large tables when prerequisites are met) | Synapse writes Parquet to Azure Blob via CREATE EXTERNAL TABLE AS SELECT; Snowflake loads from an external stage. | Pre-created Synapse external objects; cet_as_* keys in TOML; Snowflake external stage aligned with the blob container |
cloud_direct | Worker cursor extraction streamed directly to cloud object storage, skipping local disk and re-upload. | Snowflake external stage |
Synapse does not use the SQL Server bcp bulk-copy utility. Use regular (ODBC) or cet_as (server-side export) instead.
SQL authentication¶
For a serverless SQL pool, set pool_type = "serverless" and point database at the serverless database (or master).
Microsoft Entra ID (Azure AD) authentication¶
Set mode to a Microsoft Entra ID method. For a service principal, use azure_ad with client_id and client_secret:
Supported mode values are sql_auth (default), azure_ad (service principal), aad_integrated, aad_password, aad_msi (managed identity, with an optional client_id for a user-assigned identity), and trusted_connection.
Workflow example:
Tune columnNamesToPartitionBy and partitionSize for large tables. For a serverless SQL pool, set source_platform: azure_synapse_serverless.
Iceberg targets¶
Synapse as a source doesn’t prevent Apache Iceberg™ tables on Snowflake as targets. Set target.tableType to "iceberg" and supply target.icebergConfig. See Data migration configuration reference.
Using CETAS extraction¶
CETAS (CREATE EXTERNAL TABLE AS SELECT) is the recommended extraction strategy for large Synapse tables when Azure Blob Storage and a Snowflake external stage are available. Instead of streaming result sets through the Worker over ODBC, Synapse writes Parquet files directly to Azure Blob. The Worker then loads those files into Snowflake from the external stage, skipping re-upload.
When to use CETAS¶
Use CETAS when:
- Synapse has a
DATABASE SCOPED CREDENTIALwith access to an Azure Blob container. - You can create a Snowflake external stage pointing at the same container.
Use regular (ODBC) when data volume is small, or when those prerequisites aren’t in place yet.
Prompt (when prerequisites are met):
Prompt (when Azure Blob and the external stage aren’t ready yet, or volume is small):
Setup¶
1. Create the Synapse external objects (ahead of time on the source):
2. Create a Snowflake external stage pointing at the same Azure container:
3. Add CETAS settings to Worker TOML. Reference the external data source and file format by name; CETAS is enabled when both are set:
cet_as_path_prefix is an optional folder prefix inside the container. The export schema defaults to dbo; override it with cet_as_table_schema.
4. Reference the stage in your workflow YAML:
Data type mappings¶
Synapse dedicated SQL pool supports a subset of the SQL Server type system. Types that Synapse doesn’t support are not part of the migration mapping.
| Synapse type | Snowflake target type | Supported for migration | Notes |
|---|---|---|---|
| TINYINT, SMALLINT, INT, BIGINT | NUMBER | Yes | |
| DECIMAL(p,s), NUMERIC(p,s) | NUMBER | Yes | Precision and scale carried from the source catalog |
| MONEY, SMALLMONEY | NUMBER(38, 4) | Yes | |
| FLOAT, REAL | FLOAT | Yes | |
| BIT | BOOLEAN | Yes | |
| CHAR(n), VARCHAR(n), NCHAR(n), NVARCHAR(n) | VARCHAR | Yes | Includes VARCHAR(MAX) and NVARCHAR(MAX) |
| DATE | DATE | Yes | |
| TIME(n) | TIME | Yes | |
| DATETIME, DATETIME2(n), SMALLDATETIME | TIMESTAMP_NTZ | Yes | |
| DATETIMEOFFSET(n) | TIMESTAMP_TZ | Yes | Time zone offset preserved |
| BINARY(n), VARBINARY(n) | BINARY | Yes | Includes VARBINARY(MAX) |
| UNIQUEIDENTIFIER | VARCHAR | Yes | Stored as a UUID string |
| SYSNAME | VARCHAR | Yes | |
| XML, SQL_VARIANT | No | Not supported on Synapse dedicated SQL pool | |
| GEOGRAPHY, GEOMETRY | No | Not supported on Synapse dedicated SQL pool | |
| HIERARCHYID | No | Not supported on Synapse dedicated SQL pool | |
| IMAGE, TEXT, NTEXT | No | Not supported on Synapse dedicated SQL pool |
Platform-specific considerations¶
-
Dedicated vs. serverless SQL pool: Set
pool_typein Worker TOML and matchsource_platformin the workflow (azure_synapseorazure_synapse_serverless). Metadata queries differ between the two pool types, so keep both settings aligned. -
CETAS for throughput: Prefer CETAS for large tables once the Synapse external objects and the Snowflake external stage are in place. Reserve
regular(ODBC) for small volume or when those prerequisites aren’t set up yet. See Using CETAS extraction.Prompt:
-
Partitioning: Tune
columnNamesToPartitionByandpartitionSizefor large or uneven tables.Prompt:
-
Encryption:
encryptdefaults to enabled with ODBC Driver 18. Setencryptandtrust_server_certificateexplicitly in lab or hardened environments. -
Anti-locking: Hints are off by default. On busy source tables, set
queryModifiers.objectModifierto" WITH (NOLOCK)"to avoid blocking on source locks, at the cost of dirty reads. See Anti-locking and query modifiers.