Search code examples
javaazureazure-virtual-machineazure-appserviceazure-files

AzureFiles access denied Linux


I'm stuck with a problem of file access in my virtual machine.
I actually have two app services (linux) with a mounting point to the AzureFiles. This actually works but I'm trying to put one of the app on a virtual machine (ubuntu 20).

I can connect the AzureFiles using the provided script by Azure with the protocol SMB. But I have got some errors using my apps (Java):

AccessDeniedException NoSuchFileException
Files.move() // for f in directory Files.delete(f)
Files are mount with 777 with nogroup nobody on the app service app, and 777 root root on the azure vm Files are correctly detected by the for loop, but nosuchfile is thrown by delete.

Here are the mounting points :

App service : //mystorage.file.core.windows.net/mypath /mypath cifs rw,relatime,vers=3.1.1,cache=strict,username=myusername,uid=0,noforceuid,gid=0,noforcegid,addr=x.x.x.x,file_mode=0777,dir_mode=0777,soft,persistenthandles,nounix,serverino,mapposix,mfsymlinks,noperm,rsize=1048576,wsize=1048576,bsize=1048576,echo_interval=60,actimeo=1 0 0

VM: //mystorage.file.core.windows.net/mypath /mypath cifs nofail,credentials=/etc/smbcredentials/mystorage.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30

EDIT : It seems to be stuck only with files created by the application on the VM. If I upload a file with Azure Strorage explorer, the delete function works.

Any idea why it doesn't work ? Thanks


Solution

  • It was a SMB performance issue, adjusting echo_interval=60,actimeo=1 solves the problem.