Jordan Holcombe
Jordan Holcombe

Reputation: 11

Cannot copy data from Snowflake into Azure Blob

I am trying to copy data from Snowflake into an Azure Blob using Azure Data Factory.

The role I am using has select permissions on the table, and I have no issues querying the data using the Snowflake console.

I am also able to copy into the targeted blob from other sources (in Azure) using the same SAS token.

This is the query I have, generated by Azure Data Factory, (with specifics omitted)

COPY INTO 'azure://****.blob.core.windows.net/snowflake-stage/********-****-****-****-************/SnowflakeExportCopyCommand/'
FROM (select * from MYSCHEMA.MYTABLE)
CREDENTIALS = (AZURE_SAS_TOKEN = '****')
FILE_FORMAT = (type = CSV COMPRESSION = GZIP RECORD_DELIMITER = '
' FIELD_OPTIONALLY_ENCLOSED_BY = '"' ESCAPE = '\\' NULL_IF = '')
HEADER = TRUE
SINGLE = FALSE
OVERWRITE = TRUE
MAX_FILE_SIZE  = 268435456

And this is the error I am getting:

ErrorCode=UserErrorOdbcOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=ERROR [42501] Failed to access remote file: access denied.

Please check your credentials,Source=Microsoft.DataTransfer.Runtime.GenericOdbcConnectors,''Type=System.Data.Odbc.OdbcException,Message=ERROR [42501] Failed to access remote file: access denied. Please check your credentials,Source=Snowflake,'

Are there more Snowflake permissions that I need in order to do this kind of copy? Or is this perhaps an issue with the write-permissions to the Azure container?

Upvotes: 1

Views: 3021

Answers (1)

Jordan Holcombe
Jordan Holcombe

Reputation: 11

The "solution" for this indicates a likely bug for the permissions on the blob itself.

Switching the container permissions to public, then back to private again fixes the issue.

Upvotes: 0

Related Questions