问题
I'm looking to only allow the upload of specific filetypes to Azure Storage to trigger an Azure Function.
Current function.json
file:
{
"scriptFile": "__init__.py",
"bindings": [{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "{name}.json",
"connection": "storage-dev"
}]
}
Would I just add another path
value like this...
"path": "{name}.json",
"path": "{name}.csv"
...or an array of values like this...
"path": [
"{name}.csv",
"{name}.json"
]
Can't seem to find an example in the docs.
EDIT: Thank you @BowmanZhu! Your guidance was awesome.
- Changed trigger to
EventGrid
- Actually was able to create a single
Advanced Filter
rather than create multiple Subscriptions:
回答1:
You want a blobtrigger to monitor two or more paths at the same time.
I can tell you simply, it's impossible. This is why you can't find the relevant documentation, because there is no such thing. If you must use blobtrigger at the same time according to your requirements, you can only use multiple blobtrigger.
But you have another option: eventgridtrigger:
You just need to create multiple event grid, and let them point to the same endpoint function.
来源:https://stackoverflow.com/questions/63946832/how-to-specify-multiple-file-types-for-azure-function-blob-trigger-input-binding