Eclipse Che on Microsoft Azure

If you’ve been following the EclipseCon these days you‘ve read a new web IDE called Eclipse Che has been launched. As it could not be otherwise, I‘ve been playing with it, seeing how it would be possible to host it on Microsoft Azure. In this post I tell you how to do it.

For now the new IDE does not use any credential for access, so you should be careful so that it is not exposed to the Internet. After thinking of different solutions I have chosen to take advantage of the virtual network, which the Linux virtual machine belongs, to make a VPN connection point to site access. Here are all the steps:

First you need to create a Virtual Network (classic) through the portal. For my demo, I have used a reduced range.

Microsoft Azure - Create virtual network classic
Microsoft Azure – Create virtual network classic

As Eclipse Che relies on Docker to manage its architecture, you can use one of the images of the gallery that already have everything you need. Click on New > search Docker select Docker on Ubuntu Server.

Microsoft Azure - Docker on Ubuntu Server
Microsoft Azure – Docker on Ubuntu Server

This is the configuration of my machine:

  • I’ve selected the network that I’ve just created, eclipse-che-vnet.
  • Changed the type of machine to A3 (4 Cores and 7 GB of RAM).
  • Selected the same group of resources that used for the vNet, in my case Eclipse-Che.
returngis-eclipse-che configuration
returngis-eclipse-che configuration

Now you must update the vNet to allow connections using point to site, in order to be able to connect to the same network as this machine, and not have to expose all the ports required by Eclipse to the world. Access to the Virtual Networks (classic) section, select the new VNet and click on You don’t have any existing VPN connections. Click here to get started.

eclipse-che-vnet - Create a VPN Connection
eclipse-che-vnet – Create a VPN Connection

Add a range for the clients that will access the network. You can also take this step to create a gateway during the creation through the option Create gateway immediately.

eclipse-che-vnet - New VPN Connection
eclipse-che-vnet – New VPN Connection

From the server’s point of view, the last step is to create a container with Eclipse Che on your machine with Docker. For this purpose you can use PuTTY, which lets you connect via SSH to the machine, using the DNS name or the public IP assigned.

how to connect with returngis-eclipse-che
how to connect with returngis-eclipse-che

Use any of them in PuTTY, port 22, and the credentials that you set when you created the machine.

returngis-eclipse-che via putty
returngis-eclipse-che via putty

Thanks to Eclipse Che documentation you can get the parameters you need to configure the server. For this example are as follows:

docker run -ti --net=host -v /var/run/docker.sock:/var/run/docker.sock -v /home/user/che/lib:/home/user/che/lib-copy -v /home/user/che/workspaces:/home/user/che/workspaces -v /home/user/che/tomcat/temp/local-storage:/home/user/che/tomcat/temp/local-storage -e CHE_DOCKER_MACHINE_HOST=192.168.0.4 codenvy/che

As you can see in the above command, I am using the environment variable CHE_DOCKER_MACHINE_HOST that allows me to indicate what the IP address is of the Eclipse Che’s host. If you run it you‘ll see that it will download the image and, once the installation is complete, start the Tomcat which hosts the environment.

Eclipse Che - Downloading codenvy che
Eclipse Che – Downloading codenvy che

The process is complete when the Tomcat is up and running.

Eclipse Che - Server startup in XXX ms
Eclipse Che – Server startup in 15210 ms

Ok, so now you have your environment ready to start playing. The only outstanding point is to connect to the same vNet from your local machine through the point to site that you generated. You can generate a certificate by yourself through the following makecert command (if you have installed Vistual Studio you can use this command from the Developer Command Prompt):

makecert -sky exchange -r -n "CN=RootCertificateName" -pe -a sha1 -len 2048 -ss My "RootCertificateName.cer"

Upload the certificate you’ve just generated.

eclipse-che-vnet - Manage certifications - Certificates
eclipse-che-vnet – Manage certifications – Certificates

Now, you need to generate the client certificate that you must install on your machine to gain access. You can do so via this command:

makecert.exe -n "CN=ClientCertificateName" -pe -sky exchange -m 96 -ss My -in "RootCertificateName" -is my -a sha1

Finally, install the VPN client on your machine to access the network.

eclipse-che-vnet - VPN Client
eclipse-che-vnet – VPN Client

Access the Windows VPN section and connect to which you just installed.

VPN - Group Eclipse-Che eclipse-che-vnet
VPN – Group Eclipse-Che eclipse-che-vnet

To access the Eclipse Che Dashboard, simply use the VM’s IP followed by port 8080 in your browser.

Eclipse Che - Dashboard
Eclipse Che – Dashboard

To check that everything works correctly, try to create a new project, where you can choose the stacks of Java, Node, PHP, ASP.NET or a blank project.

Eclipse Che - New Project
Eclipse Che – New Project

Depending on the type of project you choose, during the creation it will download and configure an image with everything you need for that workspace.

Eclipse Che - Creating workspace
Eclipse Che – Creating workspace

Once Eclipse Che has finished generating the workspace and project you can access the IDE via the OPEN PROJECT IN IDE option.

Eclipse Che IDE
Eclipse Che IDE

Cheers!