从ASP.Net MVC执行Web作业(Execute Web Jobs from ASP.Net MVC)

系统教程 行业动态 更新时间:2024-06-14 16:53:07
从ASP.Net MVC执行Web作业(Execute Web Jobs from ASP.Net MVC)

我有一个c#console应用程序,用于一些长时间运行的任务。 在我的本地系统中,我通过System.Diagnostics.Process类从ASP.Net MVC 5控制器执行它。 现在我们将它实现到azure中,因为我们的站点在开发模式的azure中部署。

我是azure的新手,所以不要怎么做。但是,我发现我发现可以上传我的控制台应用程序作为Web作业。 我可以将web作业作为触发器运行,即按需。

但现在我的问题是如何从MVC控制器执行此Web作业,因为我需要从控制器传递一些参数?

I have c# console application which is using for some long running task. In my local system I am executing it from ASP.Net MVC 5 controller by System.Diagnostics.Process class. Now we are going it to implement it into azure as our site is deployed in azure in development mode.

I am new to azure so don't how to do it.However study several article I have found that I can upload my console application as web jobs. I can run web jobs as trigger i.e. ondemand.

But now my question is how can execute this web job from MVC controller as I need to pass some argument from controller?

最满意答案

您可以设置网站以将项目推送到Azure队列,然后在每次将项目推送到队列时触发Web作业。

有一些信息,包括如何在http://www.asp.net/aspnet/overview/developing-apps-with-windows-azure/getting-started-with-windows-azure-webjobs上执行此操作的代码示例。

You can set up your web site to push an item to an Azure Queue, and then have your web job be triggered every time an item is pushed to the queue.

There is some information, including code samples for how to do that on http://www.asp.net/aspnet/overview/developing-apps-with-windows-azure/getting-started-with-windows-azure-webjobs.

更多推荐

本文发布于:2023-04-05 21:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/0628c84baf357cba1324753b04736e46.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:作业   MVC   ASP   Net   Jobs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!