简体   繁体   中英

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

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

I'm expecting, that function below will be triggered for any file in any container. Name of file and container should be in variables.

*****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);      
}

However, nothing is triggered. Any idea what is wrong?

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

I assume that there is no way to trigger Azure Function without defined concrete container currently. From the Azure Function document , we could use the Azure storage blob trigger to moniter a storage container.

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

Base on my experience, we need to create multiple Azure functions to monitor the blobs as a work-around.

Update:

As mathewec mentioned it is an opened issue , more details please refer to it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM