Skip to content

Azure deployment

marcloeb edited this page Dec 15, 2012 · 16 revisions

This short tutorial demonstrates how to deploy Cumulus Server to Windows Azure


  • Visual Studio 2010 SP1 installed
  • Windows Azure SDK 1.8 installed
  • Windows Azure Account

Recommended readings

Building x64 Cumulus Server

Windows Azure is built fully in a x64 environment. Therefore you need to build Cumulus Server for the x64 platform.

While building POCO library with Visual Studio 2010 command prompt x64 I faced an unfixed issue ( compile). Use in this case Visual Studio instead. Build the POCO libraries with debug_static_mt in the following order: Foundation, NET, UTIL, XML. Then build the LuaJIT Project with the Visual Studio Command Prompt x64 by calling msvcbuild.bat. OpenSSL x64 binaries can be downloaded and installed – it needs no build.

Move the libraries to the Cumulus Folder\External\lib. Take from each project (POCO, LUAJIT and OpenSSL) the includes and place them into Cumulus Folder\External\include.

Prepare Solution for a Windows Azure deployment

Follow the exercise “Windows Azure and Native Code”:

  1. Add a cloud project to the Cumulus Solution and use the dialog to create a worker role
  2. Use the Configuration Manager of the solution and change the CumulusLib and CumulusServer to x64 platform
  3. Keep the Output Folder of the CumulusServer (Property – Linker - General) as it is – do not follow the Exercise instruction (if you do, you cannot debug the project anymore)
  4. Build the solution
  5. Copy the following files to the worker role project and add it in Visual Studio: CumulusServer.exe, CumulusServer.ini, libeay32.dll, lua51.dll, msvcr100.dll (C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\x64\Microsoft.VC100.CRT)
  6. Configure the Windows Azure Project – open the property page of the worker role inside the Role directory: a. Configuration tab: Change the .Net trust level to Full Trust b. Configuration tab: Change the diagnostics storage account string to your account c. Endpoint: Add an input udp enpoint with the port of your choice d. Open the ServiceDefinition.csdef file and add the following element inside the WorkerRole element:
    <Runtime executionContext="elevated" /> 
  1. Open the WorkerRole.cs file of the worker role class project and add the following code to the OnStart method:
    var appRoot = Path.Combine(Environment.GetEnvironmentVariable("RoleRoot")+ @"/", @"approot");
    int port = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["RTMFP"].IPEndpoint.Port;
    StreamWriter sw = new StreamWriter("CumulusServer.ini",false);
    sw.WriteLine("port = " + port.ToString());
    var myProcess = new Process() {
    StartInfo = new ProcessStartInfo(Path.Combine(appRoot, @"CumulusServer.exe")) {
              CreateNoWindow = false,
              UseShellExecute = false,
              WorkingDirectory = appRoot

Test and deploy Solution to Windows Azure

Run the project on your computer with the Windows Azure emulator ( right click the cloud project – Debug – start new instance). After starting up you should see the CumulusServer Command Prompt.

For deploying to Azure right click the Cloud project and click publish.


Switzerland, December 13th 2012 / Marc Loeb

Something went wrong with that request. Please try again.