Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting console application on Azure or Amazon, is it possible?

I would like to know if it's possible to write a console application to port on Windows Azure.

The console application wouldn't have an interface, it would just do its work without informing what it's doing to the user. In this case it would be a socket application.

I don't want it to be a website. It wouldn't be of any addition to the project.

EDIT: Thank you all for replying to me so fast. Now I have an answer to what I've been looking for. Now my qustion is: what would it be called in Amazon? It's worker role on Azure ... now I know that thanks to all of you

like image 302
morcillo Avatar asked Jan 03 '12 11:01

morcillo


2 Answers

You can absolutely run a console application in Windows Azure, in either a Web or Worker Role (which are both Windows Server 2012 or 2008 R2/SP2), and you can typically run them unmodified. You'll need to:

  • Provide the binaries or installer for your console app, along with any additional support DLLs. You can make these a part of your deployment or store them in Blob Storage and copy them locally upon VM bootup.
  • Configure Input Endpoints for tcp/http/https ports your console app is listening on
  • Handle stdout/stderr output
  • Configure local storage for temporary files / cache / etc. that the console app needs
  • Launch your console app in either OnStart() (the preferred place, which is called prior to your VM instance being placed in the load balancer) or Run().

You need to think about how the console app runs when there are multiple VM instances. Can two instances of your console app run at the same time? If not, you'll need to set up a mutex check prior to launching your console app executable.

Steve Marx recently blogged about running the Mongoose Web Server in Windows Azure (Mongoose being a C++-based console application). All code is in the PackAndDeploy project on github, so you can take a look at how he set things up.

EDIT 7/27/2013 This answer is a bit dated. You can also run console apps in Windows or Linux Virtual Machines. And you now have Windows Server 2012 as an OS choice for web/worker role instances.

like image 94
David Makogon Avatar answered Oct 23 '22 14:10

David Makogon


On Amazon there isn't a "worker role" and related super easy deployment. You can simply deploy your console application and start it on your EC2 instance manually or through a scheduled task. If your app must run unattended and without a logged on user then you have to rely on a Windows Service deployed on AWS EC2.

like image 23
Ivan Fioravanti Avatar answered Oct 23 '22 14:10

Ivan Fioravanti