CodexBloom - Programming Q&A Platform

Azure Functions Timer Trigger Not Invoked as Expected with CRON Expression

๐Ÿ‘€ Views: 1715 ๐Ÿ’ฌ Answers: 1 ๐Ÿ“… Created: 2025-07-23
azure azure-functions timer-trigger csharp

I've encountered a strange issue with I tried several approaches but none seem to work. Hey everyone, I'm running into an issue that's driving me crazy. I'm facing an issue with my Azure Function that is supposed to be triggered by a Timer. I've set up a CRON expression to fire every 5 minutes, but it seems that the function is not being invoked consistently. Hereโ€™s the CRON expression Iโ€™m using: `"0 */5 * * * *"`. I've deployed this Azure Function using the .NET Core SDK version 3.1 and the Azure Functions Tools version 3.0. When I check the Azure Portal, I see logs that indicate the function was triggered only a couple of times over a period of several hours, rather than the expected every 5 minutes. I have tried redeploying the function, checking the Application Insights logs for any exceptions, and confirming that the Function App is not in a consumption plan that may be causing it to sleep. Additionally, I verified that the function is not throttled and that the CRON expression is properly formatted. Hereโ€™s the relevant code for the timer function: ```csharp using System; using Microsoft.Azure.WebJobs; using Microsoft.Extensions.Logging; public static class TimerFunction { [FunctionName("TimerFunction")] public static void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log) { log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); } } ``` In my local environment, everything works fine when running it with the Azure Functions Core Tools, but once deployed, the behavior is inconsistent. Has anyone experienced similar issues or have any insights on how to troubleshoot this further? Are there any specific configurations in the Azure portal I might be missing that could affect the timer trigger's reliability? I'm working on a CLI tool that needs to handle this. Is there a better approach? Has anyone else encountered this? Any ideas what could be causing this?