filipniziol
Esteemed Contributor

If you get AccessDeniedException when trying to list "/mnt/training", then I would:

1. unmount the directory:

 

dbutils.fs.unmount("/mnt/training")

 

2. mount the directory once again - check the docs:

 

access_key = "<aws-access-key>"
secret_key = "<aws-secret-key>"
encoded_secret_key = secret_key.replace("/", "%2F")
aws_bucket_name = "<aws-bucket-name>"
mount_name = "<mount-name>"

dbutils.fs.mount(f"s3a://{access_key}:{encoded_secret_key}@{aws_bucket_name}", f"/mnt/{mount_name}")
display(dbutils.fs.ls(f"/mnt/{mount_name}"))