0

I tried searching for a possible solution of how to mount a single file/folder from within the Azure File Share to an Azure Container Instance but didn't find any.

I use Azure CLI to spawn an ACI to which I mount an Azure File Share. This File Share has many folders & subfolders. I need to mount a single file from this File Share to the ACI. The file is not a secrets file to store in the Key Vaults and this file gets regularly updated. Right now, I'm mounting the entire directory and referencing the single file. I am exploring for a method/approach where only the required file can be mounted instead of entire File Share.

  • I am not aware of a solution for ACI. These questions are similar without solutions: https://stackoverflow.com/questions/68694886/azure-fileshare-using-docker-compose-to-mount-different-subfolders-files-to-vo and https://stackoverflow.com/questions/69120001/mounting-individual-files-from-an-azure-file-share-into-a-container – John Hanley Sep 15 '21 at 22:36

1 Answers1

1

I tried to reproduce but unable mount a single file/folder from Azure File Share to Azure Container Instance.

enter image description here enter image description here

Here one more thing notice whatever the files you will update in file share it will update in container as well after you mount the file share as volume to the container. May this be the reason we can not mount specific file and folder as volume in container.

enter image description here

There are some limitations to this as well.

• You can only mount Azure Files shares to Linux containers. Review more about the differences in feature support for Linux and Windows container groups in the overview.

• You can only mount the whole share and not the subfolders within it.

• Azure file share volume mount requires the Linux container run as root.

• Azure File share volume mounts are limited to CIFS support.

• Share cannot be mounted as read-only.

• You can mount multiple volumes but not with Azure CLI and would have to use ARM templates instead.

Reference: https://learn.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files https://www.c-sharpcorner.com/article/mounting-azure-file-share-as-volumes-in-azure-containers-step-by-step-demo/

RahulKumarShaw
  • 4,192
  • 2
  • 5
  • 11
  • Hello @MokshithSandeepKumar, If the answer was helpful, Could you please [Accept it as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), so that others who encounter the same issue can find this solution and fix their problem. – RahulKumarShaw Oct 01 '21 at 05:37
  • The proposed solution does not solve the actual problem but I really thank your efforts in dealing this. – Mokshith Sandeep Kumar Nov 02 '21 at 12:55
  • @MokshithSandeepKumar the solution you are looking for it is not possible. You can mount the whole share not the specific file. Because after mounting a file share as volume to container it will become common . So whatever file you will update in fileshare will reflect in container and vice versa – RahulKumarShaw Nov 02 '21 at 14:57
  • Please check same i have mentioned in limitations as well. – RahulKumarShaw Nov 02 '21 at 14:58