gpt4 book ai didi

Azure Functions - Blob 绑定(bind)中的动态 Blob 容器

转载 作者:行者123 更新时间:2023-12-03 06:54:03 26 4
gpt4 key购买 nike

我需要使用带有 Queuetrigger 的 Azure Function App 将文件添加到 Azure 存储帐户。但容器需要动态添加。这怎么可能?

        public static async Task Run(
[QueueTrigger("activitylogevents", Connection = "StorageConnectionAppSetting")] Log activitylogevents,
Dynamic ==> [Blob("{dynamicc container}/dev/bronze/logs.json", FileAccess.Read)] Stream streamIn,
ILogger log)
{ ... Code doing stuff ... }

谢谢

最佳答案

您可以使用IBinder动态定义您的BlobAttribute:

public static void MyFunction1(
[QueueTrigger("activitylogevents", Connection = "StorageConnectionAppSetting")] Log activitylogevents,
IBinder binderIn,
ILogger log)
{
var blobInAttribute = new BlobAttribute(myUrl, FileAccess.Read) { Connection = "StorageConnectionAppSetting" };
var streamIn = binderIn.Bind<Stream>(blobInAttribute);
//other code
}

关于Azure Functions - Blob 绑定(bind)中的动态 Blob 容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73291211/

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