1

My Python Azure Function configuration file (function.json) defines a Blob storage trigger.

When the Azure Function wakes up (i.e. the server shown in Live Metrics becomes online after some sleeping time) it processes all the existing blobs regardless which ones have already generated trigger events.

I noticed that the azure-webjobs-hosts/blobreceipts folder is populated with sandboxhost637nnn folders. A new sandboxhost folder is created every Azure Function wake up event. This way the function forgets previously processed blobs (no old receipts found). In the past (Dec ’19), I remember that a unique webjobs-hosts folder containing all receipts persisted across invocations.

Dejna93
  • 31
  • 4
Rik797
  • 11
  • 4
  • It processes all the exsiting blobs? But it should triggered by the added or removed. Can you offer the logs? – Cindy Pau Jan 22 '20 at 05:56
  • Try to move the blobs which have triggered the function to another different container/directory after it triggers, Then see whether this problem disappear. This seems an problem in old version. – Cindy Pau Jan 22 '20 at 06:20

2 Answers2

0

To explain why this happens:

Irrespective of your environment , the blob trigger, by design, keeps track of new & updated blobs by maintaining blob receipts in azure-webjobs-hosts container. These receipts are correlated by their **eTags** to **host ID** of your Functions runtime.

When your function wakes up, it'll result in change of your **host ID and the eTag->host ID correlations** you previously had will no longer apply which then results in the new host re-processing all of your existing blobs -- the behavior you've observed.

The recommendation is to use Event Grid trigger instead or use the Azure app service base plan for your function app which will be costlier.

Additional reference:

https://github.com/Azure/azure-webjobs-sdk/issues/1327

Hope it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27
0

I am not sure what happened to you. But this problem should not occured any more now.

This is an old problem. And the sdk has update.

BlobTriggers will be processed only once now, have a look of this:

https://azure.microsoft.com/zh-cn/blog/announcing-the-0-5-0-beta-preview-of-microsoft-azure-webjobs-sdk/

May be your problem is a new one. But you need to provide your logs and SDK you used. Then we can help you solve this. Let me know if you update later.

Cindy Pau
  • 13,085
  • 1
  • 15
  • 27