Kudu 中的 Powershell 进程超时

Powershell process timeouts in Kudu

我正在尝试在 Azure Kudu 诊断控制台中 运行 这个 PS 脚本,进程在大约 58 分钟后终止。有人知道为什么吗?

我已经研究过 Kudu 代码,但找不到 kudu 的任何限制。

$count = 3600 + 120;
$index = 0;
Write-Output "Starting timeout test. Test will run for $count seconds."
while ($count -gt $index) {
  Start-Sleep -Seconds 1
  $index = $index + 1;
  Write-Output "$index seconds passed now ..."
}
Write-Output "Completed without timeout after $index seconds!"

默认情况下,SCM 超时为 20 分钟。但是你可以通过设置来增加它:**WEBSITE_SCM_IDLE_TIMEOUT_IN_MINUTES=30**

请注意,如果您还使用 Always On 功能,则不需要这样做。

检查此线程:https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3212de5b-efd2-4c49-a247-6bc6af5c68e8/running-a-task-in-kudu-cmdpowershell-console-terminates-the-console-process?forum=windowsazurewebsitespreview

符合预期,

https://github.com/projectkudu/kudu/blob/master/Kudu.Services/Commands/PersistentCommandController.cs#L322-L326

但是这还没有记录,所以在 kudu 中留下了一个错误 git 来修复文档 https://github.com/projectkudu/kudu/issues/3025