Is there any way I can trigger this function for existing blobs?
In short NO. As you have said, it would only trigger all existing blobs for the first time.
Internally we track which blobs we have processed by storing receipts in our control container azure-webjobs-hosts
. Any blob not having a receipt, or an old receipt (based on blob ETag
) will be processed (or reprocessed). That's why your existing blobs are being processed for the first time, they don't have receipts.
BlobTrigger is currently designed to ensure that all blobs in a container matching the path pattern are eventually processed, and reprocessed any time they are updated. So after all the blobs have a receipt, when you upload or update blobs, the function will be triggered.
For more details, you could refer to this article.