Verburgh, I (Ivo) Thanks for posting your question in Microsoft Q&A. I understand the slow performance in using string
. In general, we recommend using byte[]
if the blob is small since it loads the entire blob contents into memory.
Good news! We have stream for blobs in preview and here is the announcement: Public Preview: SDK type bindings and reference doc: SDK types (preview). Please follow the instructions in our reference doc in using preview packages and also, we have a sample in our repo: BlobStreamFunction.
[Function(nameof(BlobStreamFunction))]
public async Task BlobStreamFunction(
[BlobTrigger("stream-trigger/{name}")] Stream stream, string name)
{
using var blobStreamReader = new StreamReader(stream);
var content = await blobStreamReader.ReadToEndAsync();
_logger.LogInformation("Blob name: {name} -- Blob content: {content}", name, content);
}
We appreciate your feedback and if you face issues, let me know or feel free to submit it via https://github.com/Azure/azure-functions-dotnet-worker/issues. [No ETA for GA]. I hope this helps with your question and let me know if you have any other questions.
If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.