gpt4 book ai didi

c# - 使用 blob 触发的隔离 Azure 函数时如何将 blob 作为流获取?

转载 作者:行者123 更新时间:2023-12-05 03:19:46 25 4
gpt4 key购买 nike

现在,我的函数如下所示:

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

触发时,参数blobSystem.ReadOnlyMemory<byte> 的一个实例type - 意思是,博客的所有内容都在内存中提供。我在网上看到的所有示例都有参数 string 。两者都不是System.ReadOnlyMemory<byte> ,也不是string适用于我的情况,因为我需要能够处理潜在的 1GB+ 大 blob。

对于进程内函数,blob 参数的类型为 Stream一切顺利。如何使用隔离函数将新创建的 blob 作为流进行处理?

最佳答案

自 2022 年 8 月起,不支持此操作:

查看Guide for running C# Azure Functions in an isolated process ,有一些有趣的注释:

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).

关于c# - 使用 blob 触发的隔离 Azure 函数时如何将 blob 作为流获取?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73346905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com