This is a simple scaffold for packaging a Windows Azure app that just runs an executable. The example app being executed is mongoose, but anything could take its place, including apps that don't serve up content on port 80.
WorkerRole\run.cmdto do whatever you want. (Typically launch some sort of web server or a worker process. Either way, that process should run indefinitely.)
run.cmdto build and run the application locally.
PackAndRun.cspkg. That file, along with
ServiceConfiguration.cscfgis what you need to deploy via the Windows Azure portal (or with some other tool) to get the app running in the cloud.
Understanding the Code
ServiceDefinition.csdef specifies the following:
- What size of VM to use (
- Any input endpoints (
- What command line to run (
- What environment variables to make available to the app (
WorkerRole\run.cmd is just a script to launch
mongoose-0.3.exe with the right parameters (passing the address and port from the environment).
start /w is used to ensure that
run.cmd doesn't prematurely exit. If the mongoose process ever exits, so will
run.cmd. Windows Azure would then consider the role instance to have failed, and it would restart the instance.