You can read data from a file in Microsoft Azure Data Lake Storage Gen2 using the OPENROWSET query.
On the Azure portal, navigate to the workspace you created.
Access
Open Synapse Studio
.
Navigate to
Data
, click the
Linked
tab.
Right-click a file and select
Select Top 100 rows
to use OPENROWSET query.
If you configure Azure Active Directory or Managed Identity authentication, you can use the following command to create the query:
SELECT
TOP 100 *
FROM
OPENROWSET(
BULK '0001/customer.parquet',//Relative path
FORMAT = 'PARQUET'
) AS [result]
If you configure Microsoft SQL authentication, perform the following additional steps before you create the query:
Access Microsoft SQL Server Management Studio, Azure Data Studio, or any other tool that allows access to Azure database and run the following command to create master key:
IF NOT EXISTS (SELECT * FROM sys.symmetric_keys WHERE symmetric_key_id = 101)
CREATE MASTER KEY
Run the following command to create database scoped credentials:
IF NOT EXISTS (SELECT * FROM sys.database_credentials WHERE NAME = '<Credential_Name>')