我有一个带有 2 个网络作业的 azure 网络应用程序。我只需要扩展一项网络作业。有什么方法可以独立于网站和其他网络作业进行扩展/扩展吗?
最佳答案
假设您的 WebJobs 是连续的,
来自https://github.com/projectkudu/kudu/wiki/WebJobs-API
If a continuous job is set as singleton it'll run only on a single instance opposed to running on all instances. By default, it runs on all instances.
To set a continuous job as singleton during deployment (without the need for the REST API) you can simply create a file called settings.job with the content:
{ "is_singleton": true }
and put it at the root of the (specific) WebJob directory.
您希望保留在一个实例上的 WebJobs,设置为单例。 其余的将随着您的应用服务计划自动扩展。
触发式 WebJobs 仅在一个实例上运行。
来源:与上面相同的 URL。
Invoke a triggered job
Note: if the site has multiple instances, the job will run on one of them arbitrarily.
关于c# - Azure Webjobs 的扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39079158/