0

I have Azure Function app that I was able to debug previously but now it would not trigger when I start it in Visual Studio debug mode. Function looks like this:

public static void RunDownloadTask([TimerTrigger("0 */30 * * * *")] TimerInfo timerInfo, TextWriter log)
{...}

When I started in debug in Visual studio I used to get output like the following, but now I only get the first two lines of message in console. The rest "The next 5 occurrences ..." does not show up, and the function never gets triggered. Has anyone experienced something like this and know how to fix it? Looks like the instances I deployed to Azure App Service continue to work, but I don't know why I can't run this in debug mode locally anymore.

Found the following functions:
ChaseFTPDownloader.Functions.RunDownloadTask
The next 5 occurrences of the schedule will be:
10/5/2020 4:30:00 PM
10/5/2020 5:00:00 PM
...
samsu
  • 63
  • 8
  • This is the function on my side: `public static void RunDownloadTask([TimerTrigger("0 */30 * * * *")]TimerInfo myTimer, ILogger log){...}` I am using function v3, your function should trigger, you can have a look of my answer. – Cindy Pau Oct 06 '20 at 07:37

1 Answers1

0

I can reproduce your problem:

enter image description here

This is the problem of the settings of the Visual Studio.

Solution:

Just right click your functionapp in VS and add this command to the properties of your project:

start --verbose

enter image description here

enter image description here

After that you will see the log like before:(this change is updated in recent months.)

enter image description here

I think your function should start. Why you don't see it triggered is because the cron expression of your timetrigger.(It has an interval of 30 minutes and will not trigger the first time.)

Please do a test and let me know whether this can help you.

Cindy Pau
  • 13,085
  • 1
  • 15
  • 27
  • I tried "start --verbose" as you described but didn't make a difference. I'm using v2.2.0 and it's already deployed to App Service and I won't be looking into upgrading anytime soon. – samsu Oct 07 '20 at 18:12
  • I created a new WebJob project and it worked fine, which proves that it's not my environment. I'm beginning to think that when you run in debug locally maybe it's getting blocked from accessing the timer lock in the Azure storage because it's already used by the instances running in Azure. Just my speculation. This just prevents me from running a debug mode in local setting so it's super inconvenient but I'll find a workaround. – samsu Oct 07 '20 at 18:20
  • I ended up following the suggestion given in https://stackoverflow.com/questions/40296109/azure-webjob-timer-trigger-does-not-fire which resolved my issue. – samsu Oct 16 '20 at 17:12