Mount Azure File Share on Databricks Cluster

539 Views Asked by At

I'm trying to mount an Azure File Share on a Databricks cluster and get a 'permission denied' error. mount: /mnt/test: permission denied. Adding the --verbose flag doesn't provide any additional information. Can someone please help troubleshoot?

The error appears when the mount is executed. sudo mount -t cifs //<storage_account>.file.core.windows.net/test /mnt/test -o credentials=/etc/smbcredentials/<storage_account>.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30

sudo mkdir /mnt/test
if [ ! -d "/etc/smbcredentials" ]; then
sudo mkdir /etc/smbcredentials
fi
if [ ! -f "/etc/smbcredentials/<storage_account>.cred" ]; then
    sudo bash -c 'echo "username=<storage_account>" >> /etc/smbcredentials/<storage_account>.cred'
    sudo bash -c 'echo "password=<storage_account_key>" >> /etc/smbcredentials/<storage_account>.cred'
fi
sudo chmod 600 /etc/smbcredentials/<storage_account>.cred

sudo bash -c 'echo "//<storage_account>.file.core.windows.net/test /mnt/test cifs nofail,credentials=/etc/smbcredentials/<storage_account>.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30" >> /etc/fstab'
sudo mount -t cifs //<storage_account>.file.core.windows.net/test /mnt/test -o credentials=/etc/smbcredentials/<storage_account>.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30
1

There are 1 best solutions below

1
CHEEKATLAPRADEEP On

Before you start loading Azure Files to Azure Databricks, make sure the Azure Storage File module is installed.

To install Azure Storage File module, you need to use: pip install azure-storage-file

34054-image.png.

Once module is installed you follow the stackoverflow thread to load the Azure Files to Azure Databricks.

enter image description here

For more details, please go through the link below and it has step by step instructions to set up the azure blob storage file share for your databricks cluster: https://pypi.org/project/azure-storage-file-share/