locked
Runnig a console application from asp.net mvc in azure RRS feed

  • Question

  • I am new to azure. I am developing an MVC 5 application which has a long running process. The process may take more than one hour to execute completely. So there is a console application which can be start from MVC controller and in UI user can do other works while console run in background. My main problem is how to deploy console application in azure by using git with visual studio online. I am using System.Diagnostics.Process class for starting the console. So my main problem is to deploy the console app by git and invoke it from web.

    Please help me regarding this.

    Thursday, July 3, 2014 11:57 AM

Answers

  • Did you checkout Windows Azure WebJobs? This is a feature related to Azure Websites and allows one to configure and run executable and other scripts.

    http://www.hanselman.com/blog/IntroducingWindowsAzureWebJobs.aspx


    Chief Technology Officer - Anybill Financial Services

    Thursday, July 3, 2014 1:56 PM
  • Webjobs support QueueTriggers.

    If you have your MVC controller put a message on such a queue (with the correct commandline parameters etc...) then the Webjob can get triggered and do it's magic based on the queuemessage contents.

    See https://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-webjobs-sdk-storage-queues-how-to/

    Thursday, June 11, 2015 9:06 AM
  • Hi if your using visual studio 2013 or 2015 and the Azure SDK from version 2.4 you can package a webjob console application and deploy it without leaving Visual Studio, You can convientley deploy a webjob along side a web project but it can be difficult to scale the webjob independently of the website. There are issues of potential resource contention between the website handling requests and the webjob performing its processing. Within Visual Studio it is possible to associate a webjob with a web project at a later time if you consolidate the deployment. For more info on webjobs and websites and developing a web project see http://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-deploy-webjobs
    Tuesday, August 18, 2015 7:00 PM
    Moderator

All replies

  • Did you checkout Windows Azure WebJobs? This is a feature related to Azure Websites and allows one to configure and run executable and other scripts.

    http://www.hanselman.com/blog/IntroducingWindowsAzureWebJobs.aspx


    Chief Technology Officer - Anybill Financial Services

    Thursday, July 3, 2014 1:56 PM
  • Thanks for reply Manny. I have recently study about web jobs. But I have still a problem regarding web jobs that I have not found any example/tutorial so that I can invoke a web jobs(console app) from asp.net mvc controller. Also I need to pass command line argument. How can I achieve this?
    Thursday, July 3, 2014 2:29 PM
  • Hi GYogeshKumar,

    Since this thread is more related to TFS deployment to Microsoft Azure, I will move it to the right forum for a better response. Thanks for your understanding.

    Best regards, 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, July 4, 2014 2:00 AM
    Moderator
  • Webjobs support QueueTriggers.

    If you have your MVC controller put a message on such a queue (with the correct commandline parameters etc...) then the Webjob can get triggered and do it's magic based on the queuemessage contents.

    See https://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-webjobs-sdk-storage-queues-how-to/

    Thursday, June 11, 2015 9:06 AM
  • Hi if your using visual studio 2013 or 2015 and the Azure SDK from version 2.4 you can package a webjob console application and deploy it without leaving Visual Studio, You can convientley deploy a webjob along side a web project but it can be difficult to scale the webjob independently of the website. There are issues of potential resource contention between the website handling requests and the webjob performing its processing. Within Visual Studio it is possible to associate a webjob with a web project at a later time if you consolidate the deployment. For more info on webjobs and websites and developing a web project see http://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-deploy-webjobs
    Tuesday, August 18, 2015 7:00 PM
    Moderator