Showing results for 
Search instead for 
Did you mean: 

Error while mounting ADLS in python using AccountKey

New Contributor II

I'm using the below code using Account key to mount ADLS in python but running into java.lang.IllegalArgumentException: The String is not a valid Base64-encoded string. Can you please help?

AccountKey = dbutils.secrets.get(scope="ADB_KV_Secret_Scope", key="dev-storage-account-clientid")

url = "wasbs://[email protected]"

mnt = "/mnt/findatamart"

configs =  ""


  source = url,

  mount_point = mnt,

  extra_configs ={configs:AccountKey}



Esteemed Contributor III
Esteemed Contributor III

@Krish Lam​ you need to provide more details for the config. Please refer to the below doc.

Mounting cloud object storage on Azure Databricks - Azure Databricks | Microsoft Learn

Esteemed Contributor III
Esteemed Contributor III

configs = {"": "OAuth",

     "": "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider",

     "": "<application-id>",

     "": dbutils.secrets.get(scope="<scope-name>",key="<service-credential-key-name>"),

     "": "<directory-id>/oauth2/token"}

# Optionally, you can add <directory-name> to the source URI of your mount point.


 source = "abfss://<container-name>@<storage-account-name>",

 mount_point = "/mnt/<mount-name>",

 extra_configs = configs)


  • <application-id> with the Application (client) ID for the Azure Active Directory application.
  • <scope-name> with the Databricks secret scope name.
  • <service-credential-key-name> with the name of the key containing the client secret.
  • <directory-id> with the Directory (tenant) ID for the Azure Active Directory application.
  • <container-name> with the name of a container in the ADLS Gen2 storage account.
  • <storage-account-name> with the ADLS Gen2 storage account name.
  • <mount-name> with the name of the intended mount point in DBFS.

New Contributor II

Thank you. That worked.

Not applicable

Hi @Krish Lam​ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.