Python spark.read.text Path does not exist

rba76
New Contributor

Dear all,

I want to read files with python from a storage account. I followed this instruction https://docs.microsoft.com/en-us/azure/azure-databricks/store-secrets-azure-key-vault.

This is my python code:

dbutils.fs.mount(source = "wasbs://container1@datalake1.blob.core.windows.net", mount_point = "/mnt/container1", extra_configs = {"fs.azure.sas.container1.datalake1.blob.core.windows.net":dbutils.secrets.get(scope = "secretscope", key = "secret")})

df = spark.read.text("mnt/container1/helloworld.txt")

df.show()

The mount part runs succesfull, but it is not possible to read the file which is located in the container. I got this error "AnalysisException: 'Path does not exist: dbfs:/mnt/container1/helloworld.txt;'".

Is this a security reason?

Any help would be appreciated!!! Thank you very much!!

best regards,

Rudolf