Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions Blob trigger does not fire off unless i open the function app

I have Azure Functions setup to run off a blob trigger, (so when a blob is added to a container, it should fire off). The Function does not run until i open the function app in the portal. then it will pick up any blobs that were added and process them like normal. Why do i need to open the function app in the portal to get my jobs to fire off? It's almost like the functions app goes to sleep, and then wakes up when i browse to it. How can i prevent this from happening?

here is my CRON

{
  "bindings": [
 {
  "name": "myBlob",
  "type": "blobTrigger",
  "direction": "in",
  "path": "automated-sql-export",
  "connection": "Conn"
 }
],
 "disabled": false
}
like image 437
Bullsfan127 Avatar asked Sep 20 '16 15:09

Bullsfan127


People also ask

How does Azure function blob trigger work?

The function is triggered by the creation of a blob in the test-samples-trigger container. It reads a text file from the test-samples-input container and creates a new text file in an output container based on the name of the triggered file.

Why is my Azure not triggering?

The most common cause for Azure Functions not getting triggered is that triggers are not synced properly. You can sync triggers in one of three ways: Restart your function app in the Azure portal.

How does Azure function trigger work?

Triggers are what cause a function to run. A trigger defines how a function is invoked and a function must have exactly one trigger. Triggers have associated data, which is often provided as the payload of the function.


1 Answers

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.

I 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 a Dynamic SKU things should "just work". If they're not, please log a bug here. If you're running in a Classic SKU, make sure you have Always On enabled. That's a common issue people run into.

like image 103
mathewc Avatar answered Sep 16 '22 14:09

mathewc