如何在Azure功能中定义Azure Blob存储触发器的路径

Cha*_*bub 6 azure azure-blob-storage azure-functions

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

我期待,下面的函数将被触发任何容器中的任何文件.文件和容器的名称应该是变量.

*****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);      
}
Run Code Online (Sandbox Code Playgroud)

但是,什么也没有触发.知道什么是错的吗?

Tom*_*SFT 4

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

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

Azure 存储 blob 触发器可让您监视存储容器中是否有新的和更新的 blob,并在检测到更改时运行函数代码

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

更新:

正如 Mathewec 提到的,这是一个未解决的问题,更多详细信息请参阅它。