This is especially useful if you want to develop locally and run it from Cloud Shell.
- Azure Cloud Drive containing your files
- Mounted on a Linux Azure VM
- Development from your Local Windows VM
- Create Azure Cloud Storage
- Mount it on Windows. (This process is easy)
- Mount it on Linux using above reference.
- Install
cifs-utils
. - Create local mount directory eg.
~/clouddrive
. - Copy the mount string from Azure File Share. Example
sudo mount -t cifs //XYZ.file.core.windows.net/FILE-SHARE \
[mount point] -o vers=3.0,username=XYZUSERNAME,password=BASE64ENCODED==, \
dir_mode=0777,file_mode=0777,sec=ntlmssp
Now modify the string as appropriate.
- Replace
mount point
with the mount directory on Linux. E.g.~/clouddrive
- Change the file mode as desired.
0777
is the default file mode with which files and directories are mounted. But for work with SSH keys etc, this might create an issue. - The default mount is with user
root
and grouproot
. This creates trouble with Git checkouts. So add additional parametersuid=[USER]
andgid=[GROUP]
for the user and group on your Linux machine.
Final Modified Connect String
sudo mount -t cifs //XYZ.file.core.windows.net/FILE-SHARE \
~/clouddrive -o vers=3.0,username=XYZUSERNAME,password=BASE64ENCODED==, \
dir_mode=0777,file_mode=0777,uid=vish,gid=vish,sec=ntlmssp
Now run this string on your Linux machine. This should succeed if your options are correct.
Note: you can do a permanent mount by storing it in /etc/fstab.