.NET Core 是否支持创建由 Azure QueueTrigger 启动的 Web 作业?
Does .NET Core support creating webjobs that get started by an Azure QueueTrigger?
我有一个现有的网络作业 (.NET 4.6.1) 运行 没问题,只要消息到达队列就会被触发。我正在研究如何将一些应用程序迁移到 .NET Core 1.0,作为其中的一部分,我做了一些研究。
目前看来,.NET Core 1.0 仅支持 运行 计划中的 Web 作业,没有特殊的 Web 作业功能,例如此示例:https://blog.kloud.com.au/2016/06/08/azure-webjobs-with-dotnet-core-rc2/
要让队列消息触发作业,我需要 Webjob 包的功能。当我添加任何 WebJobs Nuget 包(包括测试版)时,出现错误:
Package Microsoft.Azure.WebJobs.Core 2.0.0-beta2 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Azure.WebJobs.Core 2.0.0-beta2 supports: net45 (.NETFramework,Version=v4.5)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
我确实按照以下所述为 Azure 存储应用了解决方法:
https://jeremiedevillard.wordpress.com/2016/09/27/use-the-azure-storage-library-in-netcore-application/
但这显然没有解决 Webjob 包的问题。
我知道在 .NET Core 网站旁边部署非 .NET Core webjob 的一些解决方法,如下所述:How do I deploy an Azure WebJob alongside a .NET Core Web App via Git?
但是 - 虽然这可行 - 我只想知道我是否可以将我的网络作业移植到 .NET Core 1。
有谁知道这样做的方法吗?
TIA,
耶伦
据我所知,目前不支持在.NET Core 中使用WebJobs SDK 的Azure WebJobs。以下是从 davidebbo mentioned. More details info please refer to the issue.
中截取的内容
To clarify, Azure WebJobs that use .NET Core work fine. It's specifically the use of the WebJobs SDK that is not yet supported.
由于 Azure 存储队列中没有 push/notify 机制,它仍在轮询。
您可以每隔 X 秒轮询一次队列并检查新消息。无论如何,这就是 SDK 正在做的事情,但是以一种文明、优雅的方式。这样做没有错。
Azure Storage Queues
Push-style API: No
Service Bus Queues
Push-style API: Yes
OnMessage and OnMessage sessions .NET API.
我有一个现有的网络作业 (.NET 4.6.1) 运行 没问题,只要消息到达队列就会被触发。我正在研究如何将一些应用程序迁移到 .NET Core 1.0,作为其中的一部分,我做了一些研究。
目前看来,.NET Core 1.0 仅支持 运行 计划中的 Web 作业,没有特殊的 Web 作业功能,例如此示例:https://blog.kloud.com.au/2016/06/08/azure-webjobs-with-dotnet-core-rc2/
要让队列消息触发作业,我需要 Webjob 包的功能。当我添加任何 WebJobs Nuget 包(包括测试版)时,出现错误:
Package Microsoft.Azure.WebJobs.Core 2.0.0-beta2 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Azure.WebJobs.Core 2.0.0-beta2 supports: net45 (.NETFramework,Version=v4.5)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
我确实按照以下所述为 Azure 存储应用了解决方法: https://jeremiedevillard.wordpress.com/2016/09/27/use-the-azure-storage-library-in-netcore-application/ 但这显然没有解决 Webjob 包的问题。
我知道在 .NET Core 网站旁边部署非 .NET Core webjob 的一些解决方法,如下所述:How do I deploy an Azure WebJob alongside a .NET Core Web App via Git? 但是 - 虽然这可行 - 我只想知道我是否可以将我的网络作业移植到 .NET Core 1。
有谁知道这样做的方法吗?
TIA, 耶伦
据我所知,目前不支持在.NET Core 中使用WebJobs SDK 的Azure WebJobs。以下是从 davidebbo mentioned. More details info please refer to the issue.
中截取的内容To clarify, Azure WebJobs that use .NET Core work fine. It's specifically the use of the WebJobs SDK that is not yet supported.
由于 Azure 存储队列中没有 push/notify 机制,它仍在轮询。
您可以每隔 X 秒轮询一次队列并检查新消息。无论如何,这就是 SDK 正在做的事情,但是以一种文明、优雅的方式。这样做没有错。
Azure Storage Queues
Push-style API: No
Service Bus Queues
Push-style API: Yes
OnMessage and OnMessage sessions .NET API.