QLServer 2019 Polybase - CREATE EXTERNAL DATA SOURCE returns unsupported URI

Scott Klein 5 Reputation points
2023-09-19T17:31:25.23+00:00

I am trying to create an external data source in SQL Server to an Azure Storage account. I have created the database scoped credential, but when I execute the CREATE EXTERNAL DATA SOURCE command, I get this:

Msg 105080, Level 16, State 1, Line 7

105080;CREATE EXTERNAL TABLE failed because the URI contains an unsupported path, fragment, user info, or query. Revise the URI and try again.

My create statement looks like this (obviously I have provided the correct container and account, just making it generic here for the sake of security):

CREATE EXTERNAL DATA SOURCE Blob_CSV

WITH

(

LOCATION = 'abs://<container>@<account>.blob.core.windows.net/',

CREDENTIAL = BlobStorageCredential

);

So I am not sure why I am getting the error. I have essentially followed the instructions here:

https://learn.microsoft.com/en-us/sql/relational-databases/polybase/virtualize-csv?view=sql-server-ver16

Thanks in advance.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
SQL Server Other
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-09-19T21:04:38.4133333+00:00

    Did you include the angle brackets in the URI? Those are only mark that the values are placeholders.


  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-09-19T21:42:02.2133333+00:00

    I look the external data source I have set up, and it looks slightly different:

    CREATE EXTERNAL DATA SOURCE [testelitest_container] WITH 
    (LOCATION = N'abs://MyResourceGroup.blob.core.windows.net/testelitest', CREDENTIAL = [testelitest])
    

    So there is no @ in it. Then again, when I added a @ in the middle of it that worked. I should add that this is on SQL 2022. My Polybase on SQL 2019 is broken.


  3. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-09-20T21:05:22.1733333+00:00

    I think there is a quite simple answer. The URL in your original question ends in sql-server-ver16, and SQL 16 is SQL 2022. And this page says that it applies to SQL 2022 with no mention of earlier versions. So the abs interface is simply not available on SQL 2019. It seems that you can use wasb for blob storage on SQL 2019, but you may not get the direct CSV support. See https://learn.microsoft.com/en-us/sql/t-sql/statements/create-external-data-source-transact-sql?view=sql-server-ver15&tabs=dedicated.

    0 comments No comments

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.