3

I have an Azure function running on a consumption service plan (Y1:0) on a Windows OS that is triggered by an Azure Service Bus queue item. However, the Azure function idles for extended periods of time and will not pull in queue items from the Service Bus. The following represent some of the idling issues:

  • Items being added onto the Service Bus and waiting 30-minutes to 1 hour or more to be dequeued and processed by the Azure function.

  • The Azure function processes a few items from the Service Bus and stops, leaving all other queued items to sit idle for similar time spans to the above point.

  • Items in the Service Bus dead lettering after 3 delivery attempts, but there are no logs or execution counts on Azure that indicate the function attempted to execute

The problem here isn't that a cold start takes a few minutes to get going, it's that the function seems to sit idle for extended periods of time and when or how long these idle periods happen seem to be random. During these idle periods, sometimes the function's memory working set will be above 0 and after long periods of time, it will drop to 0.

If items were left long enough in the Service Bus queue and did not dead letter, the Azure function would eventually process them. And occasionally, the function pulls from the Service Bus quickly. However, I need the function to run more consistently. From what I have read, the idle times I am experiencing are uncharacteristic for a consumption-based Azure function.

Here is more information on the function and Service Bus:

Service Bus

lockDuration: 'PT5M'
requiresDuplicateDetection: false
requiresSession: false
defaultMessageTimeToLive: 'P14D'
deadLetteringOnMessageExpiration: false
enableBatchedOperations: true
duplicateDetectionHistoryTimeWindow: 'PT10M'
maxDeliveryCount: 3
status: 'Active'
enablePartitioning: false
enableExpress: false

Function

sku: {
    name: Y1
}
kind: 'windows'
netFrameworkVersion: 'v6.0'

The following is the host.json file. However, I am using Azure Infrastructure as Code so some shared properties are defined in a bicep file.

{
"version": "2.0",
"logging": {
    "applicationInsights": {
        "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request"
        }
    }
}

}

Based on other posts, I have tried switching the managed identity permissions of the function to be an owner instead of a receiver (since I am not using connection strings) but that has not solved any of the issues outlined previously.

TCR
  • 45
  • 1
  • 4
  • I am assuming you are using the service bus binding and running extension.5x for your functions and can you please pate what is in your host.json for the function app https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus?tabs=in-process%2Cextensionv5%2Cextensionv3&pivots=programming-language-csharp#hostjson-settings – Ricky Gummadi Dec 19 '22 at 22:48
  • @RickyGummadi I added that for you – TCR Dec 19 '22 at 22:58

0 Answers0