1

I am getting error when trying to connect to Azure blob storage from Azure Data WareHouse

Msg 105019, Level 16, State 1, Line 100
EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_Connect. Java exception message:
Parameters provided to connect to the Azure storage account are not valid.: Error [Parameters provided to connect to the Azure storage account are not valid.] occurred while accessing external file.'

CREATE DATABASE SCOPED CREDENTIAL AzureStorageCredential  
    WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
    SECRET = 'abcdeXXXXXXXXXXXXXXXXXXXXXXXXX';


CREATE EXTERNAL DATA SOURCE MyAzureStorage1 WITH (
        TYPE = HADOOP, 
        LOCATION = 'wasb://Container@mydwblob.blob.core.windows.net/',
        CREDENTIAL = AzureStorageCredential  
    );


CREATE EXTERNAL TABLE dbo.MyExternalTable(   
    VendorID varchar(50) NULL,  
)  
WITH (  
        LOCATION='/2016/', DATA_SOURCE = MyAzureStorage1, 
        FILE_FORMAT = myfileformat,REJECT_TYPE = VALUE,REJECT_VALUE = 1000
        myfileformat,REJECT_TYPE = VALUE,REJECT_VALUE = 1000
    ) ; 

What could be not right ?

GregGalloway
  • 11,355
  • 3
  • 16
  • 47
user3799325
  • 590
  • 1
  • 8
  • 20
  • Could you post your SAS token (or at least some sanitized version that looks a bit more like it than your current sanitized token)? – GregGalloway Oct 09 '17 at 00:40
  • Two things to check: 1. make sure the SAS tokens valid _from_ date is a few days before. I had a connection issue and I _think_ that GMT messed me up. 2. Make sure your SAS key doesn't start with the `?` symbol – Nick.Mc Oct 09 '17 at 02:07

1 Answers1

1

PolyBase does not support SAS tokens. You will need to use the storage account key. For more information check ou https://learn.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-overview-load

ckarst
  • 751
  • 5
  • 11
  • Can confirm in 2022 that swapping from a SAS Token to an Access Key solved the error. The error message itself has changed slightly over the years -- now it is: "External file access failed due to internal error: 'Parameters provided to connect to the Azure storage account are not valid.'" – Mike May 31 '22 at 00:36