azure - 将 Windows 服务发布为 AZURE WEBJOB

标签 azure nservicebus webjob

我有一个 NserviceBus 处理程序,通常作为服务安装在虚拟机上。我们正在尝试让它作为 PAAS 在 Azure 上运行。因此,我们的想法是将解决方案发布为 azure webjob。当我将其发布为网络作业时,我会收到待启动状态。日志表明以下内容。

[02/27/2017 09:35:10 > 2cf107: SYS INFO] Run script 'ENSource.Handlers.exe' with script host - 'WindowsScriptHost'
[02/27/2017 09:35:10 > 2cf107: SYS INFO] Status changed to Running
[02/27/2017 09:35:10 > 2cf107: INFO] Cannot start service from the command line or a debugger.  A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.
[02/27/2017 09:35:10 > 2cf107: SYS INFO] Status changed to Success
[02/27/2017 09:35:10 > 2cf107: SYS INFO] Process went down, waiting for 60 seconds
[02/27/2017 09:35:10 > 2cf107: SYS INFO] Status changed to PendingRestart

我错过了什么?如何让 NServiceBus 处理程序在 Azure 上充当 WebJobs?

最佳答案

我将重写该服务,使其不再是 Windows 服务,而是控制台应用程序。然后,您可以告诉 WebJob 主机run it on a schedule (或者通过利用 WebJobs SDK 使其连续,如果这对您的场景更有意义)。

另一种方法,正如 Thiago 已经提到的那样,就是在云服务上的辅助角色中安装 Windows 服务: https://blogs.msdn.microsoft.com/golive/2011/02/11/installing-a-windows-service-in-a-windows-azure-worker-role/

做起来并不直接,但也不可怕。

关于azure - 将 Windows 服务发布为 AZURE WEBJOB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42482747/

相关文章:

Azure CLI 获取当前订阅详细信息

azure - 如何为 Azure 媒体服务 v3 编码空音轨?

web-services - 将 .ASMX Web 服务部署到 Windows Azure

.net - NServiceBus 与 Unity 2.0?

azure - 如何在 Visual Studio 2015 中获取最新的 "Add Azure Webjob Dialog"?

azure - PostAsync 在控制台应用程序中工作 - 不在 SSIS 包内工作

php - 如何使 PHPlush() 在 Azure Web 应用程序上工作?

c# - 您将加密 key 放在面向公众的服务器上的什么位置?

azure - 带有 Azure 和 XML 序列化器的 NServiceBus

azure - 如何从 vNext Build 运行 Azure WebJob?