I'm following the documentation here to mount an Azure blob storage container to Databricks:
https://docs.databricks.com/_static/notebooks/data-sources/mount-azure-blob-storage.html
However, I get an error while attempting this.
Here is my code:
dbutils.fs.mount(
source = "wasbs://log@my-storage.blob.core.windows.net",
mount_point = "/mnt/log/",
extra_configs = {"fs.azure.account.key.my-storage.blob.core.windows.net": dbutils.secrets.get(scope = "my-scope", key = "my-key")}
)
Here is the error:
shaded.databricks.org.apache.hadoop.fs.azure.AzureException: java.lang.IllegalArgumentException: The String is not a valid Base64-encoded string.
I am able to just run dbutils.secrets.get to retrieve the secret like so:
dbutils.secrets.get(scope = "my-scope", key = "my-key")
Output:
Out[12]: '[REDACTED]'
I expect this since it should not print the secret to the output. However, I would think I would get a permissions error or the like if I was not able to pass this value through to the extra_configs parameter.
Also, I am able to mount it easily if I directly insert the access key into the extra_configs parameter like so:
dbutils.fs.mount(
source = "wasbs://log@my-storage.blob.core.windows.net",
mount_point = "/mnt/log/",
extra_configs = {"fs.azure.account.key.my-storage.blob.core.windows.net": "my-access-key")}
)
The problem is I can do this in DEV, but need to pass the secret instead in the upper environments.
Any help is much appreciated! Thanks!



