2

I observed this strange issue with azure function which is triggered by a service bus queue message.

Azure function is continuous running which is trigger when service bus queue gets new message.

but when there is no message into queue for long time like suppose 1-2 days and when new message come into queue after 2 days ,Its strange that azure function does not get triggered , why any clue?

 public static class TestController
    {
        [FunctionName("TestController")]
        public static async Task Run([ServiceBusTrigger("%TestController.Topic%", "%TestController.Subscription%", AccessRights.Listen,
            Connection = "ConnServiceBus")]BrokeredMessage currentMessage, TraceWriter log, ExecutionContext context)
        {
            log.Info("TestControllerprocessing start " + DateTime.Now);
Neo
  • 15,491
  • 59
  • 215
  • 405

1 Answers1

1

Try force resyncing your triggers by hitting the Refresh button. This is a known issue for Azure Functions that are idle for a nondeterministic period of time. Also, verify if you're seeing the messages in the dead letter queue.

Prevent your Azure Function from going idle to begin by enabling "Always On": Open your Function App in the Azure portal. Click on Function App Settings at the top of the Function App blade. Scroll to the bottom of the page and click on Go to App Service Settings. In the Settings blade, scroll down and click on Application Settings. In the Application Settings blade, make sure that the Always On setting is set to On.

BDL
  • 21,052
  • 22
  • 49
  • 55
Mehdi Ibrahim
  • 2,434
  • 1
  • 13
  • 13
  • yea i tried with restart and it works but refresh / restart is not perfect solution for production :( any other solution we can do for this issue ? – Neo Aug 30 '18 at 06:16
  • message is not in dead letter queue – Neo Aug 30 '18 at 06:26
  • 1
    Prevent your Azure Function from going idle to begin by enabling "Always On": Open your Function App in the Azure portal. Click on Function App Settings at the top of the Function App blade. Scroll to the bottom of the page and click on Go to App Service Settings. In the Settings blade, scroll down and click on Application Settings. In the Application Settings blade, make sure that the Always On setting is set to On. – Mehdi Ibrahim Aug 30 '18 at 06:26
  • i found it on website application properties but not in Azure function properties :( – Neo Aug 30 '18 at 06:54
  • i didn't found always on because my hosting plan was consumption. :) thanks a lot – Neo Aug 30 '18 at 07:21
  • 1
    Always On is only available on the Free/Basic/Standard/Premium App Service Plan. Consumption Plan is supposed to automatically wake up your functions, but apparently it's not doing this. Try switching to another plan and enabling this feature to see if it makes a difference. – Mehdi Ibrahim Aug 30 '18 at 16:22
  • thanks but other functions are working fine no idle issue i found into them they are also on consumption plan ? why only one function ? – Neo Sep 14 '18 at 06:29