Jeson Martajaya
Jeson Martajaya

Reputation: 7352

Azure Data Lake - Creating U-SQL External Data Source from connection string

How to create U-SQL Data Source with connection string ?

This is my attempt, it has issue in setting the CREDENTIAL parameter.

CREATE DATA SOURCE MyAzureSQLDBDataSource
FROM AZURESQLDB
WITH
(
    PROVIDER_STRING = "Database=mySampleDB;",
    CREDENTIAL = "Server=mySampleDB.database.windows.net;User ID=myUser;Password=myPasswd",
    REMOTABLE_TYPES = (bool, byte, sbyte, short, ushort, int, uint, long, ulong, decimal, float, double, string, DateTime)
);

Error message:

error External0: E_CSC_USER_INVALIDDATASOURCEOPTIONVALUE: Invalid value '"Server=mySampleDB.database.windows.net;User ID=myUser;Password=myPasswd"' for data source option 'CREDENTIAL'.
Description:
The only valid values for 'CREDENTIAL' are identifiers or two-part identifiers.
Resolution:
Use a valid value.

Upvotes: 0

Views: 320

Answers (2)

Michael Rys
Michael Rys

Reputation: 6684

To expand on David's answer.

Since U-SQL scripts are stored at least temporarily in the cluster, we cannot allow the inclusion of secrets in the script. Instead, you need to create the credential in the metadata via an Azure PowerShell command (or SDK) and then refer to that credential in the CREATE DATA SOURCE statement. The documentation link provided by David contains some examples.

Upvotes: 1

David Paul Giroux
David Paul Giroux

Reputation: 657

Have you reviewed CREATE DATA SOURCE (U-SQL)?

Upvotes: 2

Related Questions