Skip to content

Commit 5b2d0e8

Browse files
Merge pull request #279015 from Clare-Zheng82/0621-Add_Snowflake_integration_doc
[New feature] Add Snowflake storage integration
2 parents eafe57d + 4a5ad4a commit 5b2d0e8

File tree

3 files changed

+46
-19
lines changed

3 files changed

+46
-19
lines changed

articles/data-factory/connector-snowflake-legacy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: data-factory
88
ms.subservice: data-movement
99
ms.topic: conceptual
1010
ms.custom: synapse
11-
ms.date: 05/22/2024
11+
ms.date: 07/02/2024
1212
---
1313

1414
# Copy and transform data in Snowflake using Azure Data Factory or Azure Synapse Analytics (legacy)
@@ -253,7 +253,7 @@ If your sink data store and format meet the criteria described in this section,
253253
"typeProperties": {
254254
"source": {
255255
"type": "SnowflakeSource",
256-
"sqlReaderQuery": "SELECT * FROM MYTABLE",
256+
"query": "SELECT * FROM MYTABLE",
257257
"exportSettings": {
258258
"type": "SnowflakeExportCopyCommand",
259259
"additionalCopyOptions": {
@@ -304,7 +304,7 @@ To use this feature, create an [Azure Blob storage linked service](connector-azu
304304
"typeProperties": {
305305
"source": {
306306
"type": "SnowflakeSource",
307-
"sqlReaderQuery": "SELECT * FROM MyTable",
307+
"query": "SELECT * FROM MyTable",
308308
"exportSettings": {
309309
"type": "SnowflakeExportCopyCommand"
310310
}

articles/data-factory/connector-snowflake.md

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: data-factory
88
ms.subservice: data-movement
99
ms.topic: conceptual
1010
ms.custom: synapse
11-
ms.date: 05/22/2024
11+
ms.date: 06/24/2024
1212
---
1313

1414
# Copy and transform data in Snowflake using Azure Data Factory or Azure Synapse Analytics
@@ -267,6 +267,7 @@ To copy data from Snowflake, the following properties are supported in the Copy
267267
| exportSettings | Advanced settings used to retrieve data from Snowflake. You can configure the ones supported by the COPY into command that the service will pass through when you invoke the statement. | Yes |
268268
| ***Under `exportSettings`:*** | | |
269269
| type | The type of export command, set to **SnowflakeExportCopyCommand**. | Yes |
270+
| storageIntegration | Specify the name of your storage integration that you created in the Snowflake. For the prerequisite steps of using the storage integration, see [Configuring a Snowflake storage integration](https://docs.snowflake.com/en/user-guide/data-load-azure-config#option-1-configuring-a-snowflake-storage-integration). | No |
270271
| additionalCopyOptions | Additional copy options, provided as a dictionary of key-value pairs. Examples: MAX_FILE_SIZE, OVERWRITE. For more information, see [Snowflake Copy Options](https://docs.snowflake.com/en/sql-reference/sql/copy-into-location.html#copy-options-copyoptions). | No |
271272
| additionalFormatOptions | Additional file format options that are provided to COPY command as a dictionary of key-value pairs. Examples: DATE_FORMAT, TIME_FORMAT, TIMESTAMP_FORMAT. For more information, see [Snowflake Format Type Options](https://docs.snowflake.com/en/sql-reference/sql/copy-into-location.html#format-type-options-formattypeoptions). | No |
272273

@@ -279,7 +280,17 @@ To copy data from Snowflake, the following properties are supported in the Copy
279280

280281
If your sink data store and format meet the criteria described in this section, you can use the Copy activity to directly copy from Snowflake to sink. The service checks the settings and fails the Copy activity run if the following criteria isn't met:
281282

282-
- The **sink linked service** is [**Azure Blob storage**](connector-azure-blob-storage.md) with **shared access signature** authentication. If you want to directly copy data to Azure Data Lake Storage Gen2 in the following supported format, you can create an Azure Blob linked service with SAS authentication against your ADLS Gen2 account, to avoid using [staged copy from Snowflake](#staged-copy-from-snowflake).
283+
- When you specify `storageIntegration` in the source:
284+
285+
The sink data store is the Azure Blob Storage that you referred in the external stage in Snowflake. You need to complete the following steps before copying data:
286+
287+
1. Create an [**Azure Blob Storage**](connector-azure-blob-storage.md) linked service for the sink Azure Blob Storage with any supported authentication types.
288+
289+
2. Grant at least **Storage Blob Data Contributor** role to the Snowflake service principal in the sink Azure Blob Storage **Access Control (IAM)**.
290+
291+
- When you don't specify `storageIntegration` in the source:
292+
293+
The **sink linked service** is [**Azure Blob storage**](connector-azure-blob-storage.md) with **shared access signature** authentication. If you want to directly copy data to Azure Data Lake Storage Gen2 in the following supported format, you can create an Azure Blob Storage linked service with SAS authentication against your Azure Data Lake Storage Gen2 account, to avoid using [staged copy from Snowflake](#staged-copy-from-snowflake).
283294

284295
- The **sink data format** is of **Parquet**, **delimited text**, or **JSON** with the following configurations:
285296

@@ -318,7 +329,7 @@ If your sink data store and format meet the criteria described in this section,
318329
"typeProperties": {
319330
"source": {
320331
"type": "SnowflakeV2Source",
321-
"sqlReaderQuery": "SELECT * FROM MYTABLE",
332+
"query": "SELECT * FROM MYTABLE",
322333
"exportSettings": {
323334
"type": "SnowflakeExportCopyCommand",
324335
"additionalCopyOptions": {
@@ -327,7 +338,8 @@ If your sink data store and format meet the criteria described in this section,
327338
},
328339
"additionalFormatOptions": {
329340
"DATE_FORMAT": "'MM/DD/YYYY'"
330-
}
341+
},
342+
"storageIntegration": "< Snowflake storage integration name >"
331343
}
332344
},
333345
"sink": {
@@ -344,8 +356,9 @@ When your sink data store or format isn't natively compatible with the Snowflake
344356

345357
To use this feature, create an [Azure Blob storage linked service](connector-azure-blob-storage.md#linked-service-properties) that refers to the Azure storage account as the interim staging. Then specify the `enableStaging` and `stagingSettings` properties in the Copy activity.
346358

347-
> [!NOTE]
348-
> The staging Azure Blob storage linked service must use shared access signature authentication, as required by the Snowflake COPY command. Make sure you grant proper access permission to Snowflake in the staging Azure Blob storage. To learn more about this, see this [article](https://docs.snowflake.com/en/user-guide/data-load-azure-config.html#option-2-generating-a-sas-token).
359+
- When you specify `storageIntegration` in the source, the interim staging Azure Blob Storage should be the one that you referred in the external stage in Snowflake. Ensure that you create an [Azure Blob Storage](connector-azure-blob-storage.md) linked service for it with any supported authentication, and grant at least **Storage Blob Data Contributor** role to the Snowflake service principal in the staging Azure Blob Storage **Access Control (IAM)**.
360+
361+
- When you don't specify `storageIntegration` in the source, the staging Azure Blob Storage linked service must use shared access signature authentication, as required by the Snowflake COPY command. Make sure you grant proper access permission to Snowflake in the staging Azure Blob Storage. To learn more about this, see this [article](https://docs.snowflake.com/en/user-guide/data-load-azure-config.html#option-2-generating-a-sas-token).
349362

350363
**Example:**
351364

@@ -369,9 +382,10 @@ To use this feature, create an [Azure Blob storage linked service](connector-azu
369382
"typeProperties": {
370383
"source": {
371384
"type": "SnowflakeV2Source",
372-
"sqlReaderQuery": "SELECT * FROM MyTable",
385+
"query": "SELECT * FROM MyTable",
373386
"exportSettings": {
374-
"type": "SnowflakeExportCopyCommand"
387+
"type": "SnowflakeExportCopyCommand",
388+
"storageIntegration": "< Snowflake storage integration name >"
375389
}
376390
},
377391
"sink": {
@@ -405,6 +419,7 @@ To copy data to Snowflake, the following properties are supported in the Copy ac
405419
| importSettings | Advanced settings used to write data into Snowflake. You can configure the ones supported by the COPY into command that the service will pass through when you invoke the statement. | Yes |
406420
| ***Under `importSettings`:*** | | |
407421
| type | The type of import command, set to **SnowflakeImportCopyCommand**. | Yes |
422+
| storageIntegration | Specify the name of your storage integration that you created in the Snowflake. For the prerequisite steps of using the storage integration, see [Configuring a Snowflake storage integration](https://docs.snowflake.com/en/user-guide/data-load-azure-config#option-1-configuring-a-snowflake-storage-integration). | No |
408423
| additionalCopyOptions | Additional copy options, provided as a dictionary of key-value pairs. Examples: ON_ERROR, FORCE, LOAD_UNCERTAIN_FILES. For more information, see [Snowflake Copy Options](https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#copy-options-copyoptions). | No |
409424
| additionalFormatOptions | Additional file format options provided to the COPY command, provided as a dictionary of key-value pairs. Examples: DATE_FORMAT, TIME_FORMAT, TIMESTAMP_FORMAT. For more information, see [Snowflake Format Type Options](https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#format-type-options-formattypeoptions). | No |
410425

@@ -421,7 +436,17 @@ To copy data to Snowflake, the following properties are supported in the Copy ac
421436

422437
If your source data store and format meet the criteria described in this section, you can use the Copy activity to directly copy from source to Snowflake. The service checks the settings and fails the Copy activity run if the following criteria isn't met:
423438

424-
- The **source linked service** is [**Azure Blob storage**](connector-azure-blob-storage.md) with **shared access signature** authentication. If you want to directly copy data from Azure Data Lake Storage Gen2 in the following supported format, you can create an Azure Blob linked service with SAS authentication against your ADLS Gen2 account, to avoid using [staged copy to Snowflake](#staged-copy-to-snowflake).
439+
- When you specify `storageIntegration` in the sink:
440+
441+
The source data store is the Azure Blob Storage that you referred in the external stage in Snowflake. You need to complete the following steps before copying data:
442+
443+
1. Create an [**Azure Blob Storage**](connector-azure-blob-storage.md) linked service for the source Azure Blob Storage with any supported authentication types.
444+
445+
2. Grant at least **Storage Blob Data Reader** role to the Snowflake service principal in the source Azure Blob Storage **Access Control (IAM)**.
446+
447+
- When you don't specify `storageIntegration` in the sink:
448+
449+
The **source linked service** is [**Azure Blob storage**](connector-azure-blob-storage.md) with **shared access signature** authentication. If you want to directly copy data from Azure Data Lake Storage Gen2 in the following supported format, you can create an Azure Blob Storage linked service with SAS authentication against your Azure Data Lake Storage Gen2 account, to avoid using [staged copy to Snowflake](#staged-copy-to-snowflake).
425450

426451
- The **source data format** is **Parquet**, **Delimited text**, or **JSON** with the following configurations:
427452

@@ -476,7 +501,8 @@ If your source data store and format meet the criteria described in this section
476501
},
477502
"fileFormatOptions": {
478503
"DATE_FORMAT": "YYYY-MM-DD"
479-
}
504+
},
505+
"storageIntegration": "< Snowflake storage integration name >"
480506
}
481507
}
482508
}
@@ -490,8 +516,9 @@ When your source data store or format isn't natively compatible with the Snowfla
490516

491517
To use this feature, create an [Azure Blob storage linked service](connector-azure-blob-storage.md#linked-service-properties) that refers to the Azure storage account as the interim staging. Then specify the `enableStaging` and `stagingSettings` properties in the Copy activity.
492518

493-
> [!NOTE]
494-
> The staging Azure Blob storage linked service need to use shared access signature authentication as required by the Snowflake COPY command.
519+
- When you specify `storageIntegration` in the sink, the interim staging Azure Blob Storage should be the one that you referred in the external stage in Snowflake. Ensure that you create an [Azure Blob Storage](connector-azure-blob-storage.md) linked service for it with any supported authentication, and grant at least **Storage Blob Data Reader** role to the Snowflake service principal in the staging Azure Blob Storage **Access Control (IAM)**.
520+
521+
- When you don't specify `storageIntegration` in the sink, the staging Azure Blob Storage linked service need to use shared access signature authentication as required by the Snowflake COPY command.
495522

496523
**Example:**
497524

@@ -519,7 +546,8 @@ To use this feature, create an [Azure Blob storage linked service](connector-azu
519546
"sink": {
520547
"type": "SnowflakeV2Sink",
521548
"importSettings": {
522-
"type": "SnowflakeImportCopyCommand"
549+
"type": "SnowflakeImportCopyCommand",
550+
"storageIntegration": "< Snowflake storage integration name >"
523551
}
524552
},
525553
"enableStaging": true,
@@ -645,7 +673,6 @@ The Snowflake connector offers new functionalities and is compatible with most f
645673
| :----------- | :------- |
646674
| Support Basic and Key pair authentication. | Support Basic authentication. |
647675
| Script parameters are not supported in Script activity currently. As an alternative, utilize dynamic expressions for script parameters. For more information, see [Expressions and functions in Azure Data Factory and Azure Synapse Analytics](control-flow-expression-language-functions.md). | Support script parameters in Script activity. |
648-
| Multiple SQL statements execution in Script activity is not supported currently. To execute multiple SQL statements, divide the query into several script blocks. | Support multiple SQL statements execution in Script activity. |
649676
| Support BigDecimal in Lookup activity. The NUMBER type, as defined in Snowflake, will be displayed as a string in Lookup activity. | BigDecimal is not supported in Lookup activity. |
650677

651678
## Related content

articles/data-factory/copy-activity-performance-features.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: data-factory
88
ms.subservice: data-movement
99
ms.topic: conceptual
1010
ms.custom: synapse
11-
ms.date: 06/17/2024
11+
ms.date: 06/24/2024
1212

1313
---
1414

@@ -153,7 +153,7 @@ Configure the **enableStaging** setting in the copy activity to specify whether
153153
| --- | --- | --- | --- |
154154
| enableStaging |Specify whether you want to copy data via an interim staging store. |False |No |
155155
| linkedServiceName |Specify the name of an [Azure Blob storage](connector-azure-blob-storage.md#linked-service-properties) or [Azure Data Lake Storage Gen2](connector-azure-data-lake-storage.md#linked-service-properties) linked service, which refers to the instance of Storage that you use as an interim staging store. |N/A |Yes, when **enableStaging** is set to TRUE |
156-
| path |Specify the path that you want to contain the staged data. If you don't provide a path, the service creates a container to store temporary data. |N/A |No |
156+
| path |Specify the path that you want to contain the staged data. If you don't provide a path, the service creates a container to store temporary data. |N/A |No (Yes when `storageIntegration` in Snowflake connector is specified) |
157157
| enableCompression |Specifies whether data should be compressed before it's copied to the destination. This setting reduces the volume of data being transferred. |False |No |
158158

159159
>[!NOTE]

0 commit comments

Comments
 (0)