My task runs once a day when deployed. For development currently I just changed the CRON to "every minute" and wait for that minute to hit in order for the function to be triggered for me to do the debugging. Is there a way such that I can leave my timer code to stay as "Every day" but still be able to kick it off manually.
In Azure I can just go to the function resource and click "Run" that will start it regardless of the timer. I am looking for something similar on my dev.
Navigate to your function app in the Azure portal, select App Keys, and then the _master key. In the Edit key section, copy the key value to your clipboard, and then select OK. After copying the _master key, select Code + Test, and then select Logs.
If you want to call admin API to trigger your timer function, you need to add your function master key in your request or you'll get 401 Unauthorized. Find it on Function app settings panel >Host Keys (All functions)> _master. Add it in your request header x-functions-key:<masterkey> .
There are no plans to support multiple triggers per Function. You will have to create a Function for each EventHub. If there is common code that may be shared between Functions, you may move them to a helper method that can be called from each Function.
Go to the Azure icon in the Activity bar. Under Local Project , find the function you want to run, right click, and select "Execute Function Now".
It doesn't look like there is a direct solution available to manually (or even through and http request) trigger a time based Azure function.
Possible Workaround
Have a second http triggered function that has the same logic/code. You can use this 2nd function for testing on demand basis.
Please see the discussion in these 2 threads, it's very relevant to you -
Any method for testing timer trigger function
Time triggered azure function to trigger immediately after deploy
You are probably looking for this on the Timer Trigger attribute,
[TimerTrigger("", RunOnStartup = true)]TimerInfo timer
That should kick it off on startup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With