我有一个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.
更多推荐
发布评论