Search code examples
azure-functionsazure-storage

'touch' a file in Azure storage so that it is reprocessed by an Azure blog storage trigger function


I have an Azure function that runs based on an Azure blob storage trigger. I am wondering if it's possible to somehow mark a file that has previously triggered my Azure function to be reprocessed by the function. Would soft-deleting and then restoring the file work to re-trigger my function, for example? Is there a more canonical way to do this?


Solution

  • Based on the blob trigger official doc:

    The Blob storage trigger starts a function when a new or updated blob is detected.

    If you want to retrigger the blob trigger and reprocess your blob, I think the most elegant way to do this is by adding metadata to your blob, this operation will be considered as an update action and fire the blob trigger.

    I have tested on my local, when I add/update blob metadata, for instance,I add/update metadata reprocess with a timestamp, the trigger has been fired:

    enter image description here enter image description here