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
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:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With