Connect ADLS From Azure Databricks Without Scope And Key

In this blog, you will learn how you can connect ADLS Gen2 or Azure Blob from Azure Databricks.

We have the syntax available in both Databricks and Microsoft doc sites. Both come with Azure Key Vault and Databricks Scope. We always need to consider storing the blob key in Azure Key Vault and use it in the scope of the script.

Recommended Syntax

dbutils.fs.mount(
  source = "wasbs://<container-name>@<storage-account-name>.blob.core.windows.net",
  mount_point = "/mnt/<mount-name>",
  extra_configs = {"<conf-key>":dbutils.secrets.get(scope = "<scope-name>", key = "<key-name>")
})  

If you want to learn or start work with files in Databricks it is still possible. It means you need to set up an Azure Key Vault and scope. Use this is for non-prod activities. Always go with the above secure method.

#Mount ADLS without using Azure Key Vault
dbutils.fs.mount(
  source = "wasbs://<container-name>@<storage-account-name>.blob.core.windows.net",
  mount_point = "/mnt/<mount-name>",
  extra_configs = {"fs.azure.account.key.<storage-account-name>.blob.core.windows.net":"<storage key>"})

Replace the <container-name>, <storage-account-name>, <mount-name> & <storage key> with appropriate details.

Happy Learning.