Play 2: How to deploy dist app for Windows Azure Cloud Services (not VM)

Q: What is the way to deploy the Play application for Windows Azure Cloud Services (and not the virtual machine)?

Background: I need to deploy a small application in Azure, and I would like to do this using the usual dist packaging method (it creates a folder with all the necessary *.jar files + start script that can be run on any system with JDK installed). I need to add that I would not want to use the Starter Kit for Java + WAR packaging as ... I'm working on , so I will need to buy / lower the next Windows machine for this task only (The Kit works only on Win) .

Unfortunately, I have no experience with Azure. If I mixed too much or if this is not possible without the WAR + Kit, please let me also know;)

+4
source share
2 answers

For the Devoxx conference here in Belgium, Steve Marx created the Scala application with a Play platform that runs on Windows Azure. Instead of using the Starter Kit for Java, it uses packageanddeploy (a simple scaffold that packs an Azure application).

Read his blog post Using Scala and the Azure ' Windows Playback Platform, or take a look at the project on github .

But there is one small problem, it also uses cspack.exe , for which I think there is no alternative on the Mac. cspack is used to create a package that you deploy to Windows Azure. Now I do not think this is a show stopper.

On his blog, Steve talks about the WorkerRole \ downloadstuff.ps1 file, which downloads Java and the Play platform. You can expand it to download the application (packaged in a zip file). Thus, your package will be very static (just a few scripts that will load the acutal application), and you will not need to run cspack every time you want to deploy.

Now, if you do not want to buy a Windows machine, you can do the following:

  • Based on Steve's blog post, change downloadstuff.ps1 to download the application from the blob repository.
  • Download the application in the blob repository.
  • Creating a virtual machine
  • Connect using RDP to this virtual machine and install the Azure SDK, tools, ...
  • Create a package using cspack (see in the packageanddeploy project) to create a static package containing all the scripts.
  • Remove the virtual machine, now that you have the package, you will no longer need
  • Deploy the package to the cloud service, this will run your scripts, start loading your application, and you will have the application running.
  • Every time you want to deploy, you simply upload the new version of your application to the storage account and you will redeploy the static package without using Windows
+5
source

As far as I know, the Cloud Service (PaaS) package can only be created from Windows, so a Windows machine is currently required.

Visual Studio is probably the easiest tool to create your own cloud service, but you will need to learn about VS and the non-standard way to create an Azure application. It can be quite an investment.

You can install cmd and run the application (not just the Java EE WAR application) from the Azure plugin in Eclipse. If you already know Eclipse, this can be a quick way to create a cloud services package.

If you chose the Eclipse method, you can create your own application image as follows:

  • Create a new Azure project, do not specify an application server and JVM.
  • Check out the script launch example (basically it unpacks jvm, the application server, transfers the war to the deployment folder and starts the application server). The step for the application server and another application is similar: install and run it, the startup.cmd file can do this for your application.
  • Make a similar script to install your application: unzip jvm, application or package manager. Put each item in the right place, and then run the application (remember to call it with the start command to make sure the script is completed)

When you understand how this works, you should try to make your Azure package more flexible by installing the archive in Blob support and downloading it at startup. This will increase the development efficiency, trust me. In the second step, you can configure the launch of the script by downloading another script or configuration file, which you can specify in the ServiceConfiguration.csfg file, which will allow you to limit the loading of your Windows machine ...

+1
source

All Articles