azure-blob-storageazure-databricksmount

Trouble to access azure containers from Azure/databricks


I am having trouble to access Azure container from Azure/Databricks. I follow instructions from this tuto, so I started to create my container and generate sas. Then on a databricks notebook I delivered the following command dbutils.fs.mount( source = endpoint_source, mount_point = mountPoint_folder, extra_configs = {config : sas})

where I replace endppoint_source, mountPoint_folder, sas by the following

container_name = "containertobesharedwithdatabricks"
storage_account_name = "atabricksstorageaccount"
storage_account_url = storage_account_name + ".blob.core.windows.net"  
sas = "?sv=2021-06-08&ss=bfqt&srt=o&sp=rwdlacupiytfx&se=..."
endpoint_source = "wasbs://"+ storage_account_url + "/" + container_name  
mountPoint_folder = "/mnt/projet8"
config = "fs.azure.sas."+ container_name + "."+ storage_account_url

but I ended with the following exception: shaded.databricks.org.apache.hadoop.fs.azure.AzureException: shaded.databricks.org.apache.hadoop.fs.azure.AzureException: Container $root in account atabricksstorageaccount.blob.core.windows.net not found, and we can't create it using anoynomous credentials, and no credentials found for them in the configuration.

I cannot figure out why databricks cannot find the root container. Any help would be mutch appreciated. Thanks in advance.

The storage account and folder exist, as can be seen from this capture, so I am puzzled out.

enter image description here


Solution

  • My bad..., I put a "/" instead of "@" between the container_name and the storage_account_url and inverse the order, so the right syntax is:

    endpoint_source = "wasbs://"+ container_name + "@" + storage_account_url