Home > Mobile >  How to get blob as Stream when using blob-triggered Isolated Azure Function?
How to get blob as Stream when using blob-triggered Isolated Azure Function?

Time:08-15

Right now, my function looks like this:

[Function(nameof(Functions.ProcessUpload))]
public void ProcessUpload([BlobTrigger("integration/{name}")] object blob, string name)
{           
}

When triggered, parameter blob is an instance of System.ReadOnlyMemory<byte> type - meaning, all contents of the blog are provided in memory. All the examples I saw online have the parameter as a string. Neither System.ReadOnlyMemory<byte>, nor string are applicable in my case, since I need to be able to work with potentially 1GB big blobs.

With in-process functions, the blob parameter was of type Stream and everything worked. How can I process newly created blobs as streams with Isolated functions?

CodePudding user response:

As per August 2022, this is not supported:

Looking at the Guide for running C# Azure Functions in an isolated process, there are some interesting notes:

Because .NET isolated projects run in a separate worker process, bindings can't take advantage of rich binding classes, such as ICollector<T>, IAsyncCollector<T>, and CloudBlockBlob. There's also no direct support for types inherited from underlying service SDKs, such as DocumentClient and BrokeredMessage. Instead, bindings rely on strings, arrays, and serializable types, such as plain old class objects (POCOs).

  • Related