[英]is that possible to change time trigger for azure functions without publishing (e.g. run all x minutes )?
We are using timer triggered azure function with c#. We must change the last time more often than the NCRON-expression.我们正在使用定时器触发 azure function 和 c#。我们必须比 NCRON 表达式更频繁地更改上次时间。
eg run all 5 minutes ("0 */5 * * * *") instead all 10 minutes ("0 */10 * * * *")例如,运行所有 5 分钟(“0 */5 * * * *”)而不是所有 10 分钟(“0 */10 * * * *”)
We deploy with run from package (ZIP-Deploy).我们从 package (ZIP-Deploy) 运行部署。
Is this possible to change the NCRON-Expression without publishing and change it with the Azure portal or in server-files with FTP or similar?是否可以在不发布的情况下更改 NCRON 表达式,并使用 Azure 门户或在具有 FTP 或类似内容的服务器文件中进行更改?
I have created the Azure Function App .NET 6 Timer Trigger of the CRON Expression ("0 */10 * * * *")
with Zip Deploy.我已经创建了 Azure Function App .NET 6 CRON 表达式的定时器触发器("0 */10 * * * *")
和 Zip 部署。 So, I cannot edit the CRON Expression as shown here:所以,我无法编辑 CRON 表达式,如下所示:
Is this possible to change the NCRON-Expression without publishing and change it with the Azure portal or in server-files with FTP or similar?是否可以在不发布的情况下更改 NCRON 表达式,并使用 Azure 门户或在具有 FTP 或类似内容的服务器文件中进行更改?
AFAIK, To Edit the Timer Trigger Function App in Portal Menu, one of the workarounds is to write the CRON expression in local.settings.json
file:据我所知,要在门户菜单中编辑计时器触发器 Function 应用程序,解决方法之一是在local.settings.json
文件中写入 CRON 表达式:
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"cron-expression": "0 */10 * * * *"
}
}
Timer Trigger Function Code :定时器触发器 Function 代码:
public void Run([TimerTrigger("%cron-expression%")] TimerInfo myTimer, ILogger log)
Publish using zip deploy to the Azure Portal Function App and create the app setting cron-expression
to 0 */10 * * * *
.使用 zip 发布部署到 Azure 门户 Function 应用程序并创建应用程序,将cron-expression
设置为0 */10 * * * *
。
OR或者
In the Publish Window of VS, click on ellipsis icon > Select Manage Azure App Service Settings
> Whatever the setting you want to publish to Azure Function App such as CRON Expression - click on Insert Value from local
> Ok > Publish the Function Project.在 VS 的 Publish Window 中,点击省略号图标 > Select Manage Azure App Service Settings
> Whatever the setting you want to publish to Azure Function App such as CRON Expression - 点击Insert Value from local
> Ok > Publish 98 Project 83886
After publishing for the 1st time, no need to publish for the change in CRON Expression, you can modify it using Azure Function App Configuration Menu .第一次发布后,CRON Expression 中的变化不需要发布,可以通过 Azure Function App Configuration Menu 修改。
After Modification through Azure portal :通过Azure传送门修改后:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.