This is a very short entry for mounting Azure Files in a virtual machine. As usual, this is one of the many ways. I checked it and it just works. We will need the name Storage Account, which we will enter instead of ‘STORAGE_ACCOUNT’. The key that we enter instead of ‘STORAGE_KEY’ and of course the name of the resource, which I called ‘myshare’.
All we have to do is log in to our Linux machine and run one long command:
mount -t cifs //STORAGE_ACCOUNT.file.core.windows.net/myshare /mnt/MyAzureFileShare -o vers=3.0,username= STORAGE_ACCOUNT,password=STORAGE_KEY,dir_mode=0777,file_mode=0777,serverino
If we want the connection to be permanent and we do not have to run the above command after each restart of our machine, add the following code to /etc/fstab:
// STORAGE_ACCOUNT.file.core.windows.net/myshare /mnt/MyAzureFileShare cifs vers=3.0,username=STORAGE_ACCOUNT,password=STORAGE_KEY,dir_mode=0777,file_mode=0777
On the microsoft website you will find full documentation about the Azure Files service https://docs.microsoft.com/pl-pl/azure/storage/files/
If you are interested in this article, check out the others on Microsoft Azure category https://lepczynski.it/en/category/azure_en/