Monday, April 3, 2023

Mounting Blob containers from Azure using blobfuse2

Quite a few tutorials exist around the internet helping with tips on how to achieve this seemingly simple task.  However, most of them choose the happy path and describe the simpler use cases. 

Let me showcase some of the less visible tips - 

1. if you are mounting into an already existing (non empty) directory, the mount call will fail
2. if your config file is picked up from baseconfig.yaml (from github page of blobfuse2), you need to take note of a few things - 

    a. the sample config file is not setup to allow other users to see the mounts / contents.  You should change the entry "allow_other" to true from the example false. This change wont work unless you edit the /etc/fuse.conf file and uncomment the line #user_allow_other

    b. the sample config file also indicates the storage type to be block, which works fine for flat blob storage situations. However, if you are using ADLS gen 2 for your storage account, you should indicate "adls"

3. Even though the config file has a container name entry, blobfuse2 allows you to override the container that you want to mount in the command line. for example - 
blobfuse2 mount ${targetMountDirectory} --container-name ${containerName} --config-file=${configFilePath}