I want to integrate and test Azure File Storage from my Web application, and before deploying it to the environment (where an Azure Shared folder is provisioned), I would like to test it on my local.
I have a docker container running Azurite on my local, and I am able to emulate an Azure Blob Storage Container on my local machine, connect with it and test.
I just want to be able to do the same for Azure File Storage. I don't see support for the same in Azurite or the deprecated Azure Storage Emulator. As per the 5th point of official Microsoft docs - (https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator#differences-between-the-storage-emulator-and-azure-storage), "The File service and SMB protocol service endpoints aren't currently supported in the Storage Emulator.".
Is there a way to emulate File Storage on Azurite? Or any other supporting application, docker image, etc.?
One option is to mount the file share directly to a running docker container as a CIFS share. I tested this on the latest Ubuntu docker image pulled from docker hub. To authenticate to the file share, you'll need the storage account's name and access key which can be found in the portal view for your particular storage account.
Pull the latest image and run it specifying
--privilegedflag to avoidmount: <mount-path>: permission deniederrorsInstall
cifs-utilspackage in case its missingIn my example, the file share is named
rootso I mount it at/mnt/rootin the container.Similar instructions to mount the share can also be found through the portal:
Your-Storage-Account>File shares>Your-share>Connect.