我想编写一段代码来将我的网站状态报告到状态页面,因此我正在考虑使用时间触发的作业,每 5 分钟从应用程序洞察中读取一次并向状态页面报告。
唯一让我担心的是,如果网站出现异常并且宕机了怎么办?我也应该能够报告这一点。
我知道它们位于同一物理空间,因此如果这是问题,两者都会出现故障,但是正常的异常(exception)情况又如何呢?
我找不到相关文档。
最佳答案
不,虽然 webjobs 运行 in the same sandbox它们在同一虚拟机上的不同进程中运行。它们不具有相同的 web 应用生命周期:
Azure WebJobs run within the sandbox of the web app. This means that they can access environment variables and share information, such as connection strings, with the web app. The job has access to the unique identifier of the machine that is running the job.
所以除非整个服务器宕机,否则一切都会好起来的。
关于azure - 如果 Web 应用程序出现故障,Azure Webjobs 也会出现故障吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51855070/