Not able to mount azure blob storage with azure data bricks

Rupesh Kumar Mishra 0 Reputation points
2024-09-01T17:45:58.7566667+00:00

I am using below code

#Define parameters
storage_account_name = "rupeshblob001"  # e.g., "mystorageaccount"
container_name = "testcontainer"  # e.g., "mycontainer"
mount_point = "/mnt/mymountpoint"  # e.g., "/mnt/mydata"
#If using an access key
storage_account_key ="dxtmnXpJyY/A5CrERQ0Qqj/otBPh0GBBRqGYVbWhSHamxq4uLHtF1Fh3ZrKNU5RGtaItAqCPFx4w+AStIJrj3Q=="
#Mount the storage
  dbutils.fs.mount(
  source = "wasbs://{container_name}@{storage_account_name}.blob.core.windows.net",
  mount_point = "/mnt/iotdata",
  extra_configs = {"fs.azure.account.key.{storage_account_name}.blob.core.windows.net":dbutils.secrets.get(scope = "geekcoders-secret", key = "sroragekey")})

I am getting below error when run above code from azure databricks note book. I need this help urgently. any help will be appreciated. 
ExecutionError: An error occurred while calling o420.mount. : java.io.FileNotFoundException: Operation failed: "The specified filesystem does not exist.", 404, HEAD, 
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,924 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,218 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vinod Kumar Reddy Chilupuri 660 Reputation points Microsoft Vendor
    2024-09-03T05:56:17.65+00:00

    Hi Rupesh Kumar Mishra ,
    Welcome to Microsoft Q&A, Thank you for posting your query.

    Azure Databricks is unable to locate the Blob Storage container you're trying to mount.

    Below are the steps to mount:

    1. Check Storage Account and Container Names are correct.
    2. Container should exist in storage account.
    3. In your code, you're mixing an access key with Databricks secrets. Instead of using dbutils.secrets.get(). You're already providing the storage_account_key directly, so you don't need to use the secrets function unless your key is stored in the Databricks secret scope.
    4. storage_account_name = "rupeshblob001"

    container_name = "testcontainer"

    mount_point = "/mnt/iotdata"

    Use access key directly

    storage_account_key = "dxtmnXpJyY/A5CrERQ0Qqj/otBPh0GBBRqGYVbWhSHamxq4uLHtF1Fh3ZrKNU5RGtaItAqCPFx4w+AStIJrj3Q=="

    Mount the storage

    dbutils.fs.mount(

    source = f"wasbs://{container_name}@{storage_account_name}.blob.core.windows.net",

    mount_point = mount_point,

    extra_configs = {f"fs.azure.account.key.{storage_account_name}.blob.core.windows.net": storage_account_key}

    )

    1. If you've regenerated the storage account keys recently, you may be using an outdated key.

    Please refer the below Microsoft Documentation.

    https://learn.microsoft.com/en-us/azure/databricks/dbfs/mounts

    Please let us know if you have any further queries. I’m happy to assist you further. 


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.