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?
Trigger and binding definitions json, the portal provides a UI for adding bindings in the Integration tab. You can also edit the file directly in the portal in the Code + test tab of your function. Visual Studio Code lets you easily add a binding to a function. json file by following a convenient set of prompts.
The function is triggered by the creation of a blob in the test-samples-trigger container. It reads a text file from the test-samples-input container and creates a new text file in an output container based on the name of the triggered file.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With