3
votes

I"m trying to mount azure storage blob into azure Databricks using python notebook using below code.

mount_name = '/mnt/testMount'

if not any(mount.mountPoint == mount_name for mount in dbutils.fs.mounts()):              
    dbutils.fs.mount(
        source = "wasbs://%s@%s.blob.core.windows.net" % (container, accountName),
        mount_point = mount_name,
        extra_configs = {"fs.azure.account.key.%s.blob.core.windows.net" % (accountName ) : accountKey })       

Mount was successful and I was able to see using print(dbutils.fs.mounts()) also using DBFS CLI in my linux VM. dbfs ls dbfs:/mnt/testMount

But not visible in the UI nor accessible from python notebook FileNotFoundError: [Errno 2] No such file or directory: '/mnt/testMount/'.

Can someone please let me know if you faced this issue and what is the fix?

enter image description here

Thanks

2

2 Answers

0
votes

I really recommended you can read the section Managed and unmanaged tables of the offical document User Guide > Databases and Tables.

enter image description here

So you mount Azure Blob Storage to DBFS as a part of filesystem of Azure Databricks which is belong to unmanaged table that be created by coding in notebook.

enter image description here

0
votes

In Azure databricks, you need to provide the path in Jyupter Notebook as "dbfs:/mnt/azureblobshare/<your_file_name_with_extension>"

Example: If I upload a file "MyFile.txt" then the file path in Jyupter notebook will be

filePath="dbfs:/mnt/azureblobshare/MyFile.txt"

This should work for you.