How to trigger Azure Function from any file uploaded to Azure Storage Account?

660 Views Asked by At

Single Azure Function. I want it to trigger from all files uploaded to an Azure Storage account. The Storage Account has multiple top-level containers, so I can't specify one container, must be the entire account.

How is the function.json file handled?

This doesn't seem to be triggering the Function:

{
    "scriptFile": "__init__.py",
    "bindings": [{
        "name": "myblob",
        "type": "blobTrigger",
        "direction": "in",
        "path": "{name}.json",
        "connection": "storage-dev"
    }]
}

Does the path need a leading /? ("path": "/{name}.json")

2

There are 2 best solutions below

0
ericOnline On BEST ANSWER

The way to achieve this is to use an EventGrid trigger rather than BlobTrigger. Thank you to @BowmanZhu over at this thread for guiding me.

0
Frank Borzage On

As far as I know, it is not possible to specify all containers as the trigger path in a blob trigger function. The solution I can think of is to create multiple functions and specify different containers respectively, so that you can achieve your expectations.