Home
%3CLINGO-SUB%20id%3D%22lingo-sub-807948%22%20slang%3D%22en-US%22%3EBlob%20Trigger%20function%20does%20not%20fire%20unless%20you%20visit%20the%20portal%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-807948%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20seen%20many%20cases%20where%20the%20blob%20trigger%20functions%20do%20not%20fire%20unless%20you%20explicitly%20visit%20the%20portal%20(function%20app%20blade).%20There%20might%20be%20several%20reasons%20for%20this%20issue%2C%20but%20I%20am%20going%20to%20mention%20the%20most%20common%20one.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20a%20Function%20App%20is%20running%20the%20host%20takes%20care%20of%20automatically%20receiving%2Fpolling%20for%20new%20events%20across%20all%20of%20our%20various%20trigger%20types%20(queues%2C%20event%20hubs%2C%20blobs%2C%20etc.).%20However%2C%20some%20differences%20arise%20based%20on%20the%20tier%20you're%20running%20in.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20our%20%3CSTRONG%3EDynamic%3C%2FSTRONG%3ESKUs%2C%20we%20have%20a%20service%20external%20to%20the%20Function%20App%20that%20is%20responsible%20for%20monitoring%20work%20and%20ensuring%20the%20Function%20App%20is%20running%20when%20it%20needs%20to%20be.%20When%20there%20is%20no%20work%20to%20perform%20(e.g.%2C%20no%20queue%20messages%2C%20no%20new%20blobs%2C%20etc.)%2C%20the%20Function%20App%20goes%20to%20sleep.%20It%20is%20the%20responsibility%20of%20the%20external%20service%20to%20ensure%20that%20it%20is%20woken%20up%20when%20work%20arrives.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20our%20%3CSTRONG%3EClassic%3C%2FSTRONG%3ESKUs%20(Basic%2FStandard)%20this%20external%20monitor%20is%20not%20in%20the%20picture.%20The%20Function%20App%20must%20be%20run%20in%20Always%20On%20mode%20to%20keep%20it%20alive.%20This%20setting%20should%20be%20automatically%20configured%20to%20On%20for%20you%20when%20you%20create%20a%20Function%20App%20in%20a%20classic%20tier.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20all%20that%20background%20explained%2C%20if%20you're%20running%20in%20Dynamic%20SKU%2C%20things%20should%20%22just%20work.%E2%80%9D%20If%20you're%20running%20in%20a%20Classic%20SKU%2C%20make%20sure%20you%20have%20Always%20On%20enabled.%20That's%20a%20common%20issue%20people%20run%20into.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EThe%20function%20app%20is%20running%20on%20a%20runtime%20version%20V1%3C%2FSTRONG%3E%3A%20There%20is%20a%20known%20issue%20where%20blob%20polling%20does%20not%20work%20as%20expected%20in%20the%20function%20runtime%20V1.%20This%20issue%20has%20been%20fixed%20in%20runtime%20version%20V2%3B%20however%2C%20it%20is%20not%20backported%20to%20the%20V1.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CUL%3E%0A%3CUL%3E%0A%3CLI%3EPlease%20refer%20to%20the%20following%20GitHub%20for%20additional%20details%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fgithub.com%252FAzure%252Fazure-webjobs-sdk%252Fissues%252F2194%26amp%3Bdata%3D02%257C01%257CGaurav.Patole%2540microsoft.com%257C98e98ec0917743d3f50308d720a86e5d%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637013780096088149%26amp%3Bsdata%3DyDz2L3z%252FEUMbFgbGta7qylzPmdSN900Y8q%252BqFqELrM8%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2Fazure-webjobs-sdk%2Fissues%2F2194%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EThe%20workaround%20to%20mitigate%20this%20issue%20is%20to%20change%20the%20function%20runtime%20version%20to%20V2.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EThe%20storage%20version%20is%20V2%3C%2FSTRONG%3E%3A%20Sometimes%2C%20this%20issue%20happens%20when%20the%20Storage%20which%20the%20function%20app%20is%20configured%20to%20work%20with%20is%20of%20type%20V2.%3C%2FLI%3E%0A%3CUL%3E%0A%3CLI%3EThe%20workaround%20to%20mitigate%20this%20issue%20to%20change%20the%20storage%20version%20from%20V2%20to%20V1.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ERecommendation%3C%2FSTRONG%3E%3A%20Though%20there%20is%20an%20inbuilt%20blob%20trigger%20function%2C%20it%20is%20best%20to%20set%20up%20an%20Event%20Grid%20subscription%20and%20trigger%20with%20Azure%20Functions%20when%20it%20comes%20to%20processing%20the%20blobs.%20The%20notifications%20are%20sent%20when%20blob%20operations%20take%20place.%20This%20also%20enables%20an%20improved%20experience%20when%20it%20comes%20to%20the%20speed%20Azure%20Functions%20will%20be%20able%20to%20react%20to%20those%20events.%20You%20need%20to%20create%20an%20Event%20Grid%20Trigger%20function%20and%20configure%26nbsp%3Bthe%20%E2%80%9C%3CSTRONG%3EEvent%20Grid%20Subscription%20URL%3C%2FSTRONG%3E%E2%80%9D%20from%20%3CSTRONG%3EIntegrate%3C%2FSTRONG%3Etab%20of%20the%20function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20information%20on%20the%20Event%20Grid%20trigger%20with%20Azure%20Functions%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fazure%252Fazure-functions%252Ffunctions-bindings-event-grid%26amp%3Bdata%3D02%257C01%257CGaurav.Patole%2540microsoft.com%257C98e98ec0917743d3f50308d720a86e5d%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637013780096088149%26amp%3Bsdata%3DUkl9fHY%252BZj5TCuBHyIif0Tg8P09xPc907rd1Zs51rQ4%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Ffunctions-bindings-event-grid%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EReacting%20to%20blob%20events%20using%20Event%20Grid%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fazure%252Fstorage%252Fblobs%252Fstorage-blob-event-overview%26amp%3Bdata%3D02%257C01%257CGaurav.Patole%2540microsoft.com%257C98e98ec0917743d3f50308d720a86e5d%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637013780096098136%26amp%3Bsdata%3D0Q8h55eBlWXdNVJ0feFJL6HgvGz3A%252FWit70rXrTqroY%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fblobs%2Fstorage-blob-event-overview%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3EEvent%20Grid%20subscription%20is%20only%20available%20in%20Storage%20V2.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20right%3B%22%3E%3CSTRONG%3EAuthored%20By%20-%20Sunny%20Dewangan%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

I have seen many cases where the blob trigger functions do not fire unless you explicitly visit the portal (function app blade). There might be several reasons for this issue, but I am going to mention the most common one.

 

When a Function App is running the host takes care of automatically receiving/polling for new events across all of our various trigger types (queues, event hubs, blobs, etc.). However, some differences arise based on the tier you're running in.

 

In our Dynamic SKUs, we have a service external to the Function App that is responsible for monitoring work and ensuring the Function App is running when it needs to be. When there is no work to perform (e.g., no queue messages, no new blobs, etc.), the Function App goes to sleep. It is the responsibility of the external service to ensure that it is woken up when work arrives.

 

In our Classic SKUs (Basic/Standard) this external monitor is not in the picture. The Function App must be run in Always On mode to keep it alive. This setting should be automatically configured to On for you when you create a Function App in a classic tier.

 

With all that background explained, if you're running in Dynamic SKU, things should "just work.” If you're running in a Classic SKU, make sure you have Always On enabled. That's a common issue people run into.

 

  • The function app is running on a runtime version V1 : There is a known issue where blob polling does not work as expected in the function runtime V1. This issue has been fixed in runtime version V2; however, it is not backported to the V1.

 

  • The storage version is V2: Sometimes, this issue happens when the Storage which the function app is configured to work with is of type V2.
    • The workaround to mitigate this issue to change the storage version from V2 to V1.

 

Recommendation: Though there is an inbuilt blob trigger function, it is best to set up an Event Grid subscription and trigger with Azure Functions when it comes to processing the blobs. The notifications are sent when blob operations take place. This also enables an improved experience when it comes to the speed Azure Functions will be able to react to those events. You need to create an Event Grid Trigger function and configure the “Event Grid Subscription URL” from Integrate tab of the function.

 

For information on the Event Grid trigger with Azure Functions:

  1. https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-grid

Reacting to blob events using Event Grid:

  1. https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-event-overview

 

Note: Event Grid subscription is only available in Storage V2.

 

Authored By - Sunny Dewangan