简体   繁体   English

是否可以在不发布的情况下更改 azure 函数的时间触发器(例如运行所有 x 分钟)?

[英]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.

相关问题 没有在C#中托管Powershell的C#方法是否等效于所有PowerShell功能? (例如,重命名NetAdapter) - Is there a C# method equivalent to all powershell functions without hosting powershell in C#? (e.g. Rename-NetAdapter) 是否可以查找给定类型的所有名称别名(例如,“ int”与“ Int32”)? - Is it possible to look up all name alias of a given type (e.g. “int” versus “Int32”)? Azure Functions – 时间触发器 - Azure Functions – Time Trigger Azure函数调用二进制可执行文件,将标准输出流式传输到响应(例如,node.js的child_process.spawn) - Azure Functions call a binary executable, stream standard output to response (e.g. child_process.spawn for node.js) 是否可以在例如 MemberInfo 的代码中获取 position? - Is it possible to get the position in code of e.g. MemberInfo? 是否可以默认隐藏类的属性,例如在DataGridView中? - Is it possible to hide properties of a class by default, e.g. in a DataGridView? 金融时间序列数据的NoSql(例如RavenDB)? - NoSql (e.g. RavenDB) for financial time series data? 使用DateTime持续一段时间,例如45:00 - Using DateTime for a duration of time e.g. 45:00 如何在没有UserInteractive模式的情况下进行调试(例如,服务) - How to Debug without UserInteractive mode (e.g. Services) 没有 npm 的 video.js 插件(例如 eme) - video.js plugins (e.g., eme) without npm
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM