如果我将时间表移至local.settings.json,则TimerTrigger Azure函数不会触发
下面有效
[FunctionName("Function1")]
public async Task Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
{
log.LogInformation($"Function function executed at: {DateTime.Now}");
}
,但这并没有
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"EmailScheduleTriggerTime": "0 */15 * * * *" //Run every 15 minutes
}
}
[FunctionName("Function1")]
public async Task Run([TimerTrigger("%EmailScheduleTriggerTime%")]TimerInfo myTimer, ILogger log)
{
log.LogInformation($"Function function executed at: {DateTime.Now}");
}
显示任何错误!这个问题只能在azure进行后移动。
Below works
[FunctionName("Function1")]
public async Task Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
{
log.LogInformation(quot;Function function executed at: {DateTime.Now}");
}
But, this does not
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"EmailScheduleTriggerTime": "0 */15 * * * *" //Run every 15 minutes
}
}
[FunctionName("Function1")]
public async Task Run([TimerTrigger("%EmailScheduleTriggerTime%")]TimerInfo myTimer, ILogger log)
{
log.LogInformation(quot;Function function executed at: {DateTime.Now}");
}
It's not showing any error! This issue is seen only post-deployment to the azure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们已经尝试在本地重现该问题,以下是我们遵循的步骤
cron表达式
*/15 * * * * * *
( 它将每15分钟运行 )。本地设置.json
函数1.cs
输出详细信息以供参考: -
功能触发15分钟后 : -
有关更多信息,请参阅此 博客 。
We have tried on our local to reproduce the issue, Below are the steps we have followed
cron expression
*/15 * * * *
(which will run every 15th minute).local settings.json
function1.cs
OUTPUT DETAILS FOR REFERENCE:-
FUNCTION TRIGGER THRIVING AFTER 15 MINUTE:-
For more information please refer this Blog.
实际上,在Azure上运行功能V4时,我遇到了同样的问题。
但是,将变量名称重命名为所有 开始工作正常。
因此,尝试更改为
:
Actually I had the same problem when running functions v4 on Azure.
But after renaming the variable name to all lower case it started to work just fine.
So try change to:
and