I have sas url at directory level and want to use to read contents of directory instead of using connection string
Asked
Active
Viewed 617 times
1 Answers
0
Follow below Syntax:
Create mount
dbutils.fs.mount(
source = "wasbs://<container_name>@<storage_account_name>.blob.core.windows.net/",
mount_point = "/mnt/t123",
extra_configs = {"fs.azure.sas.<container_name>.<storage_account_name>.blob.core.windows.net":"Your_SAS_token"})
Read csv file
file_location ="wasbs://<container_name>@<storage_account_name>.blob.core.windows.net/filename.csv"
df = spark.read.format("csv").option("inferSchema", "true").option("header", "true").option("delimiter",",").load(file_location)
display(df)
Reference:
Reading and Writing data in Azure Data Lake Storage Gen 2 with Azure Databricks by Ryan Kennedy

B. B. Naga Sai Vamsi
- 2,386
- 2
- 3
- 11