I have an Azure Function App running on Linux Consumption Plan with a storage file share mounted with the CLI command
az webapp config storage-account add --resource-group <resgroupname> --name <functionappname> --storage-type AzureFiles --share-name <filesharename> --account-name <storageaccountname> --mount-path /sharedata --access-key <accesskey>
In this file share there is a folder with 200-250 mb data that is needed for one of the functions. Copying from /sharedata to /tmp takes only a few ms if done in public override void Configure(IFunctionsHostBuilder builder)
in Startup class for entire Function app.
However, since only one function needs the data I would rather have the copying done first thing in the function needing it. But then the exact same code that copies a directory recursively takes 15-20 seconds to complete.
Is this expected behavior? I can't find anything in the docs I've read (quite a lot of ground to cover there) that could serve as an explanation. The copy code uses standard c# System.IO functions for listing and copying dirs and files.