Trigger Azure Function based on file type

SOHRAB SHAIKH (EXTERNAL) 41 Reputation points
2022-10-23T06:37:30.16+00:00

I created a Azure Function that is triggered when a file ( any file type json, jpeg) is dropped in blob storage.
I like to trigger the the azure function for a specific file type ( json) only
How to do this.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,693 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,084 questions
{count} votes

Accepted answer
  1. Bruno Lucas 4,396 Reputation points MVP
    2022-10-23T08:33:28.55+00:00

    Hi @SOHRAB SHAIKH (EXTERNAL)

    as specified here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp#filter-on-file-type

    you can specify the path in here:
    253230-image.png

    whenever I upload a file to my container called "documents", only files with extension "json" will trigger the azure function

    253167-image.png

    This post expands on alternatives

    https://stackoverflow.com/questions/52771563/pattern-match-blob-name-to-function-variables-with-input-binding

    Case that information helps, don't forget to vote or mark as Answer to help the community. Cheers!

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful