简体   繁体   中英

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.

在此处输入图像描述

  • Using the same approach as yours, I got the same error:

在此处输入图像描述

  • Using the following code, I was able to mount successfully. Change the endpoint_source value to the format wasbs://<container-name>@<storage-account-name>.blob.core.windows.net .
endpoint_source = 'wasbs://data@blb2301.blob.core.windows.net'
mp = '/mnt/repro'
config = "fs.azure.sas.data.blb2301.blob.core.windows.net"
sas = "<sas>"

dbutils.fs.mount( source = endpoint_source, mount_point = mp, extra_configs = {config : sas})

在此处输入图像描述

My bad..., I just missed "@" between the container and the account name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM