Search code examples
azureflutterazure-functionsazure-storageazure-blob-storage

Upload video to Blob Storage using Azure Function


In my app I would like my users to upload local videos, which I would want to store in the Blob Storage. But I would like to achieve this by using the Azure Functions. Is this possible? If so, I couldn't find any resource that could point me in the right direction. If not what would be the ideal way to achieve this. I am building the app using flutter, for which we do not yet have the SDK's. Any help is appreciated.


Solution

  • There's no SDK available for Dart. You'll have to make a back-end part running in .NET, Java, JavaScript or Python in order to use Azure Functions.

    But you can use the Azure Storage REST API to store the videos as blobs using a Storage Account.

    Take a look at the official reference here. Using this, you'll be able to store the videos using Http.

    Also, this tutorial might be useful.

    The fella here is using the File Service instead the Blob Service. A point of interest is that you have to be in mind some limitations, not that it's impossible to do what you want to, but is good to be aware:

    There are limitations to the storage service. [...] You can only upload 4mb “chunks” per upload. So if your files exeed 4mb you have to split them into parts. If you are a good programmer you can make use of tasks and await to start multiple threads. Please consult the Azure limits documentation to see if any other restrictions apply.