We are hosting an Azure Web Job Host inside a Windows Container that runs on Azure App Services for Containers.
The JobHost uses a single function that gets triggered by a BlobTrigger. Here an example:
public class MyFunc
{
[FunctionName("MyFunc")]
public Task Run([BlobTrigger("%BlobContainer%/{tenant}/{id}", Connection = "BlobEndPointConnectionString")]
Stream image,
int tenant,
int id)
{
// implementation
}
}
Everything works fine - if I add blobs to the specific storage container, the function gets executed. The function will also remove the blob after processing it.
However, it happens that the container gets restarted. In this case, previously added blobs are not processed anymore (only new ones).
Is there any way to tell the Web Job SDK to reset the scanInfo so that the function gets invoked for every existing blob?
I tried to find something related inside the SDK - without luck. I expect that I can delete the scanInfo file inside the azure-webjobs-hosts (which contains the last scan time) to achieve that. Am I right? Is that legit? Or can you suggest any other options?
In case it matters, I use HostBuilder.
As far as I know, the only solution is to delete the scanInfo file(blob receipts) inside the azure-webjobs-hosts. And yes, it is legit, you can find the official info of forcing reprocessing of a blob here.