10

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
}
Bullsfan127
  • 285
  • 6
  • 18
  • Possible duplicate of http://stackoverflow.com/questions/39430932/how-do-i-turn-on-always-on-for-an-azure-function/39431332 – David Ebbo Sep 20 '16 at 15:23

1 Answers1

5

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.

mathewc
  • 13,312
  • 2
  • 45
  • 53
  • 1
    I am using the dynamic plan, but the explanation is nice to know how it is all supposed to be working. I went to the link you provided, and saw that there was already a bug created for this very issue. So i will follow that thread. Thanks! – Bullsfan127 Sep 20 '16 at 16:13
  • i've just run into this, well, thats pretty weird. I guess we'll have to wait for a fix. – 4c74356b41 Oct 18 '16 at 20:47
  • I am still facing same issue – Yogen Darji Aug 02 '22 at 08:37