Azure function app goes into sleep , manual intervention is required to wakeup

Thangavel Daniel Tamilarasan 271 Reputation points
2022-12-09T09:40:51.513+00:00

Hi,

I have an azure function app v4 - in process with Blob trigger as you see below. This is hosted on app service with consumption plan. Time to time it goes into sleep - meaning it stops receiving the events from Blob until I manually wake it up.

To wake up - all that I need to do is navigate to the function app in portal. Then it starts processing the events. Appreciate any help to resolve this.

 [FunctionName("ArchiveFunction")]  
         public static async Task RunAsync([BlobTrigger("%BlobContainer%/{name}", Connection = "StorageConnection")] Stream myBlob, string name,  
             [CosmosDB(  
         databaseName: "PCArchive",  
         collectionName: "PCEvents",  
         ConnectionStringSetting = "CosmosDbConnectionString")]IAsyncCollector<dynamic> documentsOut, ILogger log,  
         [CosmosDB(  
         databaseName: "PCArchive",  
         collectionName: "Online_Event",  
         CreateIfNotExists =true,  
         ConnectionStringSetting = "CosmosDbConnectionString")]IAsyncCollector<dynamic> leaseSBOOut)  

         I have few other function app with isolated process, there's no problem with them.   

/Daniel

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,936 questions
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-12-19T06:29:43.753+00:00

    Function app running on consumption plan using the blob triggers rely on the Scale Controller to start up the app. The Scale Controller will poll the storage logs to determine if there are any changes/additions to the blobs. However, using the storage logs isn't 100% reliable.

    271933-image.png

    Reference : https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp#polling-and-latency

    2 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Mark Taylor 331 Reputation points
    2022-12-09T10:39:08.667+00:00

  2. Dmitriy Prokopov 1 Reputation point
    2022-12-13T14:11:08.323+00:00

    I have the same problem although with a Queue trigger.
    My function app stops processing queue messages and only wakes up when I go to its blade in the portal.
    Also on Consumption plan.
    Is this normal behavior ?


  3. Harini Vedala 20 Reputation points
    2023-06-27T19:15:51.54+00:00

    We have an InProcess .NET 7 Isolated function(with Blob Trigger) running on Consumption plan that exhibited this same behavior. We had to upgrade our plan to "Function Premium" and then the issue went away.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.