azure-databricksazure-data-lake

mounting point in azure databricks


I would like to use a mount point on azure databricks with this code:

dbutils.fs.ls('/mnt/dz/')

but i have this error

shaded.databricks.org.apache.hadoop.fs.azure.AzureException: java.util.NoSuchElementException: An error occurred while enumerating the result, check the original exception for details.

what should i do in this situation?

i have create a mounting point with this code

mountPoint = "/mnt/dz/"
if not any(mount.mountPoint == mountPoint for mount in dbutils.fs.mounts()):
  try:
    dbutils.fs.mount(
      source = "wasbs://{}@{}.blob.core.windows.net".format(blobContainerName, storageAccountName),
      mount_point = mountPoint,
      #extra_configs = {'fs.azure.account.key.' + storageAccountName + '.blob.core.windows.net': storageAccountAccessKey}
      extra_configs = {'fs.azure.sas.' + blobContainerName + '.' + storageAccountName + '.blob.core.windows.net': sasToken}
    )
    print("mount succeeded!")
  except Exception as e:
    print("mount exception", e)

the code have run well, but now

dbutils.fs.ls('/mnt/dz/')

is not working


Solution

  • shaded.databricks.org.apache.hadoop.fs.azure.AzureException: java.util.NoSuchElementException: An error occurred while enumerating the result, check the original exception for details

    The above error you are facing because you do not have list permission for that particular container in sas token.

    while creating sas token in permissions select list option: enter image description here

    Output:

    enter image description here