Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 07:00 PM
Here's a helper function I use:
def mount_blob_storage(blob_uri: str, secret: str, mnt_point: str) -> str:
""" Mount Azure Blob onto databricks.
References:
- Mounting blob storage: https://docs.databricks.com/data/data-sources/azure/azure-storage.html
Parameters
-----------
blob_uri: str
uri to blob storage container
secret: str
blob secret key for access
mnt_point: str
mount point in case do not want to use name of container
Return
--------
mnt: str
path to mounted storage in Databricks File System
"""
# Get container and account
container, account = get_storage_account_container(blob_uri)
# Define mount point
mnt = "/mnt/{}".format(mnt_point)
dbutils.fs.mount(
source = blob_uri,
mount_point = mnt,
extra_configs = {
"fs.azure.account.key.{}.blob.core.windows.net".format(account):
secret
})
return mntWhile the reference points to instructions to mount a blob storage account, the same method should work for ADLS.