如何在 Azure Function 中定义 Azure Blob Storage 触发器的路径

How to define Path for Azure Blob Storage trigger in Azure Function

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

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

*****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 Function 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 作为变通方法。

更新:

正如mathewec所说,它是一个打开的issue,更多细节请参考它。