azure webjob 中是否有全局变量?如何保留来自 webjob 执行的数据?

Is there global variable in azure webjob ? How to persist data from webjob execution?

我正在使用 Azure webjob 填充数据列表,我需要 use in my MVC Web application

但是在执行 azure webjob 之后,我没有在我在 azure web job.

中使用的那个旧对象中获取 mvc web 应用程序中的数据

Is there any global variable concept here to persist data from web job execution to mvc app?

Azure 可能 运行 您的所有实例 (reference) 上的 WebJobs,因此您的 WebJob 应该是无状态的(这是一个很好的做法)并且不应依赖任何全局变量。

为了持久化数据,取决于你的数据类型,我通常使用A​​zure Storage (Table, Queue)来存储我的WebJobs使用的一些简单数据。或者,如果它与您的数据库相关,请直接连接到那里(Auzre SQL、SQL 服务器或 MySQL)并在那里保存数据。