gpt4 book ai didi

azure - 从配置中读取 Azure 函数设置

转载 作者:行者123 更新时间:2023-12-01 09:46:48 27 4
gpt4 key购买 nike

我使用带有属性的 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com