Reputation: 16959
I am using Azure Functions 3 to upload a zip file that I need to unzip on Azure Function temporary local drive for further processing. The function will process the files and they can be deleted after the function has finished running. Is there a best practice or an example how to upload a file to Azure Function?
Upvotes: 0
Views: 1289
Reputation: 4954
You shouldn't rely on the local drive in this case. It is meant to be used by the underlying platform and has limited capacity. In high scale conditions this could be a trouble.
For Free, Shared and Consumption (Functions) sites, there is a 500MB limit for all these locations together (i.e. not per-folder).
Ref: Understanding the Azure App Service file system
Better you upload your files (zip-file in your case) on a blob container. If you want to run the Azure function every time there a new file uploaded in a certain folder, you can have a BlobTrigger for your Azure Function.
Through the binding your Azure Function will run every time there's a new file uploaded and later you can decide to cleanup the zip file after processing.
You can refer to Azure Blob storage bindings for Azure Functions.
There's a handy article by Ramesh Podishetty on zip file processing in Azure Functions which you might find useful:
https://msdevzone.wordpress.com/2017/07/07/extract-a-zip-file-stored-in-azure-blob/
Upvotes: 1