我正在使用Azure Functions with Attributes来定义功能。
public static class PostPublishTimerTrigger
{
[FunctionName("PostPublishTimerTrigger")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer,
TraceWriter log,
[Queue("post-published")] ICollector<string> postPublishedQueue)
{
// Additional code here
}
}
是否有办法为配置设置提取计划0 */5 * * * *
,是Configuration Manager
还是Environment Variables
?
谢谢!
答案 0 :(得分:7)
是的,你可以做到
[TimerTrigger("%schedule%")]
然后添加名为schedule
的设置,其值为0 */5 * * * *