Hi,
Q1
The blob storage trigger for functions uses the function app name as part of the receipt so deploying a new app would cause this to happen. Note *it is for the **function app ***and contains the function app name in the receipt.
Azure Functions stores blob receipts in a container named azure-webjobs-hosts in the Azure storage account for your function app (defined by the app setting
AzureWebJobsStorage
). A blob receipt has the following information:
- The triggered function (
<FUNCTION_APP_NAME>.Functions.<FUNCTION_NAME>
, for example:MyFunctionApp.Functions.CopyBlob
)
I have also personally seen blobs be reprocessed seemingly at random for which I have never identified a cause. Could have been this issue or another.
Q2
I see 2 real options to solving this firstly:
Firstly, it seems that, based on this post, the hostID is what is actually used for the container names / receipts and is set on deployment. You can set this via AzureFunctionsWebHost__hostid app-setting. This could work as a solution assuming that you do not run multiple functions with the same host as this will cause a collision and the apps will crash assuming framework v4 and up. More info here.
(Disclaimer - I have not tested changing the hostID so would need validating)
Alternatively, you could move the blobs to a processed folder after processing. This does ultimately mean you are not leaning on the framework and will require more work but you can be assured (bar failures) that the blobs will not be processed again. I have done this for a solution in the past due to the critical impact reprocessing the files would have on the business.
I hope this answers you question.
If it does please mark this as accepted.