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.
- Edit
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
run.cmdto build and run the application locally. - Run
pack.cmdto outputPackAndRun.cspkg. That file, along withServiceConfiguration.cscfgis what you need to deploy via the Windows Azure portal (or with some other tool) to get the app running in the cloud.
ServiceDefinition.csdef specifies the following:
- What size of VM to use (
ExtraSmall) - Any input endpoints (
HttpIn) - What command line to run (
run.cmd) - What environment variables to make available to the app (
ADDRESSandPORT)
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.