Azure WebJob 陷入初始化状态

问题描述 投票:0回答:1

我们在付费订阅的应用服务中拥有一个 WebJob。几天前,该服务进入初始化状态,此后我们一直无法启动它。

这些是输出日志: enter image description here

当我们尝试手动启动它时,我们收到错误:

enter image description here

我们也重启了应用服务,但没有效果。环境的最后一次更新是在两周多前。我很高兴该网站在周日关闭,但它现在已启动并运行,因此 WebJob 应该能够启动。

我们想要检查 Kudu,但是 Powershell 总是返回所发出命令的打印?是因为没有权限吗? enter image description here

c# .net azure azure-web-app-service azure-webjobs
1个回答
0
投票

如果您的 Web 作业未能初始化,请访问 kudu 控制台和以下路径检查您的 Web 作业日志:-

[xxxxxxxwebapwebjob.scm.azurewebsites.net/api/vfs/data/jobs/continuous/test/job_log.txt](https://xxxwebapwebjob.scm.azurewebsites.net/api/vfs/data/jobs/continuous/test/job_log.txt)

enter image description here

enter image description here

您可以直接在Webjob的日志部分查看日志:-

enter image description here

enter image description here

Get-Service
powershell 命令在 kudu 中无法获取您的 Webjob 运行状态,因为 Web 应用程序是 PAAS,我们无权访问底层操作系统,您必须调用 Webjob rest API

您还可以调用

Get-Process
命令来检查Kudu中正在运行的进程:-

enter image description here

另外,如果您的

Webjob failed to initialize

检查您的 Webjob 源代码并尝试在您的代码中实现跟踪,如 George Chen 的SO 答案中所述。

此外,在部署 Webjob 之前,请验证 Webjob 代码中的所有设置和连接字符串是否已正确设置。

© www.soinside.com 2019 - 2024. All rights reserved.