我使用带有属性的 Azure Functions 来定义功能。
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 * * * *
,无论是使用配置管理器
还是环境变量
?
谢谢!
最佳答案
是的,你可以
[TimerTrigger("%schedule%")]
然后添加名为 schedule
的设置,其值为 0 */5 * * * *
关于azure - 从配置中读取 Azure 函数设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47121627/