简体   繁体   English

将 Windows 服务迁移到 Azure

[英]Migrate Windows Service to Azure

We are migrating to Azure.我们正在迁移到 Azure。 We have a Web App deployed.我们部署了一个 Web 应用程序。 However, I have a Windows Service that I need to add in to the mix.但是,我有一个 Windows 服务需要添加到组合中。 The service continuously runs, checking the associated Service Bus Queue for messages every 5 seconds.该服务持续运行,每 5 秒检查一次关联的服务总线队列中的消息。

I am looking for recommendations on how to do this.我正在寻找有关如何执行此操作的建议。

I have looked at Web Jobs.我看过 Web 工作。 But, I don't understand how it gets kicked off.但是,我不明白它是如何开始的。 I know there is a Web Hook involved - but I just want the code to run continuously without having to be constantly kicked.我知道有一个 Web Hook 涉及 - 但我只想让代码连续运行,而不必经常被踢。

We are also trying to avoid the cost of having a VM involved.我们还试图避免涉及 VM 的成本。

Thanks in advance.提前致谢。

Since you already have a web app, you could use a Azure App Service to run the Web App.由于您已经拥有 web 应用程序,您可以使用 Azure 应用程序服务来运行 Web 应用程序。 The Azure App Service will allow you to also have a Web Job that you can have run on a schedule. Azure 应用服务将允许您还拥有可以按计划运行的 Web 作业。

It does not make sense to break you web app into Azure Functions since it is already built.将 web 应用程序分解为 Azure 函数是没有意义的,因为它已经构建了。 You can have the service run in an Azure Function, but it will probably add more complexity to interact with the web app (if that is what is happening) and if the service is running every 5 seconds, that could get costly.您可以让服务在 Azure Function 中运行,但它可能会增加与 web 应用程序交互的复杂性(如果这是每 5 秒运行一次,则可能会发生成本高昂的服务)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM