tusdotnet / tusdotnet

.NET server implementation of the Tus protocol for resumable file uploads. Read more at https://tus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tusdotnet supported under Azure Functions?

kirk-marple opened this issue · comments

We've been using Tusdotnet for a while, under a normal App Service, and I don't see any posts about if anyone has gotten this working under Azure Functions.

Is this supported, officially or unofficially?

Hi,

There have been some discussions in the tus Advisory Group regarding running any tus implementation in a serverless environment (not only Azure Functions, but AWS Lambda or the Google Cloud equivalent). It's doable but comes with some things to consider. First of, serverless is usually built for shorter bursts of traffic which might be unsuitable for large file uploads. This would probably fix itself as the client would just retry/continue the upload if a timeout occurs. Secondly you need to store your data somewhere and serverless environments usually have very limited/no disk storage.

My knowledge of Azure Functions are a few years old so if this is incorrect please let me know :) According to this page the maximum timeout for a http trigger is 230 seconds. It also seems to be possible to mount an Azure files share using smb which would solve the storage issue. If Azure Files isn't an option you could use a store that writes data directly to Azure Blob Storage such as Xtensible.TusDotNet.Azure

Thanks for the info @smatsson. I've already built a custom TusStore, which writes directly to Azure blob storage. So that part is taken care of. (I'd written it before that Xtensible Tus store was available, it looks like, but it's basically the same thing.)

We send chunks of 100MB today, so the time to process each HTTP request is definitely below 230sec, so that won't be a problem either.

And, I use Redis to cache the file metadata already, so we don't rely on requests coming back through the same endpoint.

Sounds like it might "just work"?

Definitely 👍 Can't see any problem with your setup.

Great, thanks. I'll give it a shot and let you know how it goes.

Any update how this went? 🙂

Azure's Durable Functions sound like a suitable option. We've had to use it for serverless long running processes with great success.

Closing due to inactivity