简体   繁体   English

用于批处理的Azure Windows服务

[英]Azure windows service for batch processing

I'd like to build the Azure PaaS equivalent of a "Windows Service". 我想构建与“ Windows服务”等效的Azure PaaS。 I could of course create a VM and deploy a Windows Service, but I'm looking for scalable/PaaS way to do this. 我当然可以创建一个VM并部署一个Windows Service,但是我正在寻找实现此目的的可伸缩/ PaaS方法。 Essentially my app is a back end service that monitors a queue (Azure Service Bus for example) and when a message comes in on the queue it will perform a bunch of processing logic (processing logic, accessing a database, invoking other web services, queuing other processes etc.). 从本质上讲,我的应用程序是监视队列的后端服务(例如,Azure Service Bus),当消息进入队列时,它将执行一系列处理逻辑(处理逻辑,访问数据库,调用其他Web服务,排队)其他过程等)。 Some services might need to do some more "advanced" operations like create a child app domain, write temporary files to disk, etc. 某些服务可能需要执行更多“高级”操作,例如创建子应用程序域,将临时文件写入磁盘等。

What kind of Azure solution should I be looking for to meet this need? 我应该寻找哪种Azure解决方案来满足此需求?

It feels like Azure has evolved a lot in the last couple of years and I'm confused when trying to figure out the best service to use to meet my needs. 在过去的几年中,Azure似乎发展了很多,当我试图找出最好的服务来满足我的需求时,我感到困惑。 Some project types seem obsolete now but there is still a lot of old documentation/blogs. 现在有些项目类型似乎已经过时,但是仍然有很多旧的文档/博客。 I see references to WebJobs, Worker Roles, Logic Apps, and Functions. 我看到了对WebJobs,辅助角色,逻辑应用程序和功能的引用。 Can someone more experienced in building Azure services tell me which technologies I should be looking at to meet my needs? 能在构建Azure服务方面更有经验的人能告诉我应该考虑哪些技术来满足我的需求吗?

I feel like this should be sort of obvious and a common need, but perhaps I'm just using the wrong search terms and I'm not really finding a lot of info that seems to match my exact need, or the info I do find is from 2011 and I'm worried the landscape has changed a lot since then. 我觉得这应该是显而易见的和普遍的需求,但是也许我只是使用了错误的搜索字词,而我并没有真正找到很多似乎可以满足我确切需求的信息,或者我确实找到的信息是从2011年开始的,我担心此后的情况已经发生了很大变化。

You have choices, like you say - WebJobs, Logic apps, Service Fabric or Functions, and it depends on how much control you need or want over the code you're deploying. 就像您说的那样,您可以选择-WebJobs,Logic应用程序,Service Fabric或Functions,这取决于您对部署的代码需要或想要多少控制。 Worker Roles are a Cloud Services term and although they're still supported, are generally not recommended, since the deployment, scalability and management of the other services listed is far better. 辅助角色是Cloud Services术语,尽管仍然受支持,但通常不建议使用它们,因为列出的其他服务的部署,可伸缩性和管理要好得多。

Web Jobs and Functions both use the same WebJobs SDK to provide you a load of support for triggering from queues, blobs or scheduling execution. Web作业和功能都使用相同的WebJobs SDK,为您提供了从队列,blob或计划执行触发的大量支持。 They both run within (and scale with) an app service plan, but Functions are "serverless" in that you don't need to see or manage the web app service instance, and can just deploy the source code - it will be compiled on deployment. 它们都在应用服务计划内运行(并随其扩展),但功能是“无服务器的”,因为您无需查看或管理Web应用服务实例,而只需部署源代码-即可在其中编译源代码。部署。

Service Fabric is a different beast altogether, and provides resilience and low latency state (data) replication, but could also be an option for stateless batch execution. Service Fabric完全是另一种野兽,可以提供弹性和低延迟状态(数据)复制,但是也可以作为无状态批处理的一种选择。 It creates a cluster of VM nodes under the covers which will manage the resilience and deployment for you, there's a bit more to understand and manage, but it's great for things like massive scale stateful services. 它在幕后创建了一个VM节点集群,可以为您管理弹性和部署,还有很多要理解和管理的地方,但是对于大规模的有状态服务来说非常有用。

Logic apps have a different execution/charging model, and will scale on demand, but it's more for orchestrating workflow and joining components together than actually executing your operation. 逻辑应用程序具有不同的执行/收费模型,并且可以按需扩展,但是与实际执行操作相比,它更适合用于协调工作流和将组件连接在一起。 Ie. IE浏览器。 to process the data from your queue might be a component, which needs to run somewhere - probably in an API app or an Azure function you're also hosting. 处理队列中的数据可能是一个组件,该组件需要在某个地方运行-可能在您同时托管的API应用程序或Azure函数中。

Logic Apps is designed for the exact scenario you described. Logic Apps专为您描述的确切方案而设计。

You should be able to create a Logic App that triggers on new message in a Service Bus queue. 您应该能够创建一个可以在服务总线队列中的新消息上触发的逻辑应用程序。

Then, Logic Apps natively supports interaction with SQL/Queue/REST, even on-premises file system, XML validation, X12/AS2/EDI, along with built-in functions such as parsing JSON/XML, conditions, looping, etc.. For more advanced actions not currently supported in Logic Apps, you can extend Logic Apps with Azure Functions. 然后,Logic Apps原生支持与SQL / Queue / REST的交互,甚至支持本地文件系统,XML验证,X12 / AS2 / EDI的交互,以及诸如解析JSON / XML,条件,循环等内置功能。对于Logic Apps当前不支持的更多高级操作,可以使用Azure Functions扩展Logic Apps。

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

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