Chatumbabub
Chatumbabub

Reputation: 1637

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?

Upvotes: 10

Views: 8704

Answers (1)

Tom Sun
Tom Sun

Reputation: 24529

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.

Upvotes: 4

Related Questions