gpt4 book ai didi

azure - 如何在 Azure Function 中定义 Azure Blob 存储触发器的路径

转载 作者:行者123 更新时间:2023-12-04 15:31:05 25 4
gpt4 key购买 nike

有没有办法在没有定义具体容器的情况下触发Azure Function?

我预计,任何容器中的任何文件都会触发下面的函数。文件和容器的名称应位于变量中。

*****function.json:
{
"bindings": [
{
"type": "blobTrigger",
"name": "myBlob",
"path": "{container}/{name}",
"connection": "AzureWebJobsStorage",
"direction": "in"
}
],
"disabled": false
}

*****run.csx:
public static void Run(Stream myBlob, string name, string container, TraceWriter log, out string outputSbMsg)
{
log.Info("C# Blob trigger function Processed blob");
log.Info(name);
log.Info(container);
}

但是,什么也没有触发。知道出了什么问题吗?

最佳答案

Is there a way to trigger Azure Function without defined concrete container?

我认为目前没有定义具体容器的情况下无法触发Azure Function。来自 Azure 函数 document ,我们可以使用 Azure 存储 blob 触发器来监视存储容器。

The Azure Storage blob trigger lets you monitor a storage container for new and updated blobs and run your function code when changes are detected

根据我的经验,我们需要创建多个 Azure 函数来监视 blob,作为解决方法。

更新:

正如 matheec 提到的,这是一个打开的 issue ,更多详情请引用。

关于azure - 如何在 Azure Function 中定义 Azure Blob 存储触发器的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42638717/

25 4 0
文章推荐: firebase - 如何使用 RxJava 2 改进从 Firebase 数据库读取 Flowable 数据?