Attribute error when mounting blob

braxx 436 Reputation points
2021-04-20T14:57:02.473+00:00

It is my second day with databricks and Python. So forgive me if my question sounds silly.

When mounting a blob storage container I got "Attribute error'. I previously created scope credentials and SAS token (for container), which is stored in Key-vault. I folowed a tutorial:

https://www.3cloudsolutions.com/databricks-and-azure-key-vault/

89584-capture.png

Can someone point me what I did wrong?

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,162 questions
0 comments No comments
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 88,716 Reputation points Microsoft Employee
    2021-04-21T11:42:09.567+00:00

    Hello @braxx ,

    You are experiencing this AttributeError at line3 because there is no command called saskey = dbutils.secret.get it should be saskey = dbutils.secrets.get.

    89992-image.png

    There is no command called dbutils.secret.get

    89953-image.png

    To mount a Blob Storage container or a folder inside a container, use the following command:

    storagename = "chepra"  
    containername="sampledata"  
    saskey = dbutils.secrets.get(scope = "azurestorage", key = "azurestoragekey")  
    dbutils.fs.mount(  
      source = "wasbs://sampledata@chepra.blob.core.windows.net/",  
      mount_point = "/mnt/"+ containername +"/",  
      extra_configs = {"fs.azure.sas." + containername + "." + storagename + ".blob.core.windows.net":""+ saskey +""})  
    

    89938-image.png

    Hope this helps. Do let us know if you any further queries.

    ------------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.