Hi Pan, John , Thankyou for using Microsoft Q&A platform and thanks for posting your query here. As per my understanding you are looking for way to mount ADLS gen2 using Account Key or SAS token in Azure Databricks. This can be achieved using the following code snippet : Account Key:
dbutils.fs.mount(
source = "wasbs://{containerName}@{storageAccountName}.blob.core.windows.net",
mount_point = mountPoint,
#extra_configs = {'fs.azure.account.key.' + storageAccountName + '.blob.core.windows.net': storageAccountAccessKey}
SAS token:
dbutils.fs.mount(
source ="wasbs://
mount_point = mountPoint,
extra_configs = {'fs.azure.sas.' + blobContainerName + '.' + storageAccountName + '.blob.core.windows.net': sasToken}
For more details, kindly watch out the below resources: Create Mount point using dbutils.fs.mount() in Azure Databricks Mount Azure Blob Storage to DBFS in Azure Databricks
Without having to create mount point, you can set Spark properties to configure Azure credentials to access Azure storage both using access key and SAS token , watch out the below videos for implementation :
Access ADLS Gen2 storage using Account Key in Azure Databricks
Access ADLS Gen2 or Blob Storage using a SAS token in Azure Databricks
Hope it helps. Kindly accept the answer by clicking on Accept answer
button. Thankyou