Azure Function Downloading file to Azure Virtual file share

Adrian Griffith 61 Reputation points
2022-03-12T16:56:04.89+00:00

Access to the path '\fileserver1.domain.com\directory\sub-directory' is denied. fileserver1.domain.com is a Azure VM

Users upload a file to be processed to our "azure file share" and send a request to "azure queue". That request tells us there is a file to be processed and to validate the file. Once validated, the file is downloaded to to a "shared directory" on the "azure VM file server" for processing.

I am using the Legacy SDK CloudFile.DownloadToFileAsync to copy the file. I did not see this capability in the newer "File Share" api.

As you can see, I am getting a permission error when I run from/within azure versus my own desktop. The code works using a "shared directory" on my desktop. It works with a "shared directory" on fileserver1.domain.com if I execute from my desktop. I have permissions.

Who, and how, do I grant permissions to the account executing my Azure Function. How do I grant my function the ability to write to my file server.

Thanks

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,424 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-03-14T10:35:09.793+00:00

    @Adrian Griffith ,

    Thanks for reaching out to Q&A.

    The code works in your local machine as you have write permissions on the shared directory in your desktop. However, there are restrictions in the Functions file system as it is a sanboxed environment.

    File systems restrictions and considerations : https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#file-system-restrictionsconsiderations

    The long term solution for your problem is to download and move the files to an Azure storage account.

    I hope this helps! Feel free to reach out to me if you have any further queries or concerns.


1 additional answer

Sort by: Most helpful
  1. Adrian Griffith 61 Reputation points
    2022-06-13T13:43:33.727+00:00

    Moving on to try SFTP access to Blobs.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.