How to copy a csv file from blob storage to snowflake table?

LIU, PETER 0 Reputation points
2024-11-18T20:01:42.06+00:00

Trying to copy a csv file from blob storage to snowflake table. Been trying various ways but keep getting all sorts of errors.

Getting various errors including:

ErrorCode=SnowflakeInvalidStorageIntegration,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Snowflake invalid storage integration : The specified storage account is not permitted by the snowflake storage integration. Ensure that the storage account is included in the allow list of the storage integration.,Source=Microsoft.DataTransfer.Connectors.Snowflake,'

When not specifying Storage Integration
Operation on target Copy data1 failed: ErrorCode=GenericAdoNetReadError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Failed to execute the query command during read operation.,Source=Microsoft.DataTransfer.Connectors.GenericAdoNet,''Type=Apache.Arrow.Adbc.AdbcException,Message=[Snowflake] 003001 (42501): SQL access control error:

Insufficient privileges to operate on schema 'SDW_STAR_STAGE2',Source=Apache.Arrow.Adbc,'

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,984 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ganesh Gurram 1,825 Reputation points Microsoft Vendor
    2024-11-20T17:44:37.6566667+00:00

    @LIU, PETER - Thanks for the question and using MS Q&A forum.

    I tried to repro the scenario, and the activity was completed successfully without any issues.

    Follow these steps to copy a CSV file from blob storage to snowflake table:

    • Create an Azure Data Factory.
    • Create Blob storage and upload one CSV file in it.
    • Create Linked Service for blob storage as shown in below figure. Select Authentication type as SAS URI and copy paste the SAS URL from blob storage. Click on test connection, make sure the connection must be successful. User's image
    • Create a Snowflake instance, then set up a database, warehouse and add a table to the database as illustrated in the figure. User's image
    • Create linked service for Snowflake as shown in figure. Enter Account name, Database and Warehouse names correctly from the Snowflake created. Click on test connection and save.User's image
    • Create Dataset for Blob storage. User's image
    • Create Dataset for snowflake. User's image
    • Create a pipeline and add a copy activity. Select source dataset as Blob storage. User's image
    • Select sink dataset as snowflake, click on publish all and validate and click on debug. User's image
    • Pipeline status is succeeded. User's image User's image Hope this helps. Do let us know if you have any further queries.   -------------  If this answers your query, do click `Accept Answer` and `Yes` for was this answer helpful. And, if you have any further query do let us know. 

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.