Darwino, and Java applications, on Microsoft Azure!


In a prior blog post, I showed how we deployed a Java based application to IBM BlueMix. But as you may know, the Darwino platform is pervasive and can run applications on many different applications servers, while connecting to many different relational databases.
So let's deploy a Darwino app to Azure, using TOMCAT and MS SQL Server.

Similarly to IBM Bluemix, Microsoft offers an Eclipse plugins but, unfortunately, I cannot get it to work with large Eclipse Workspaces (see issue: https://github.com/Microsoft/azure-tools-for-java/issues/15). Let's deploy the application manually, until this is fixed.

1- Create an account

My experience if you plan to keep your application running more than 30 days, then forget about the trial subscription. I initially used it but was not able to convert it to a pay-as-you-go subscription when the trial expired without involving Microsoft support. I gave up, deleted all the already deployed assets and redeployed them with the proper subscription...

2- Create your Java application

For a basic WAR deployment, then simply create an app and use the application settings, as explained here. Once done, you have an empty web site at http://xxxx.azurewebsites.net/, that you can already try:

3- Create a SQL Server database

Microsoft Azure features the latest SQL Server 2016, including the new JSON capabilities.
A database in Azure requires 2 resources:
  • A database server
  • A database instance, created within a server
The 2 resources can be created in a single step: when you create the database, it asks for a server or let you create one dynamically. 

You can test your new database from a remote machine using tools like DbVisualizer. To do so, you first need to enable access to your client IP address in the firewall. This is again an easy operation: from the database, click on the server URL then on Settings for the server and you have the firewall options. Finally, use the JDBC URL revealed by clicking 'Show database connection strings':


4- Accessing TOMCAT using FTP

Contrary to IBM Bluemix, Azure let you access your VM through FTP, which is very convenient. The connection URL and the user are available in your application information panel.
Now, this deployment model only exposes by default the TOMCAT HOME directory via FTP. But this is enough for deploying a WAR, or consult the log files.

Tip:a Darwino app is using some configuration files located outside of the WAR file. On Azure, we copy them to this home directory, and find the directory location in the code using:
String tomcat8 = System.getenv("AZURE_TOMCAT8_HOME");


5- Deploy your WAR file

Simply copy your WAR file to /site/wwwroot/webapps and TOMCAT will automatically deploy it in a handful of seconds







Now it is ready!

As you saw, deploying a Darwino application on Azure was easy. The whole steps took less than 15 mins. The Eclipse tools should make it even easier and faster, which will try when the bug mentioned earlier will be fixed.

Similarly to IBM Bluemix, I would advise developers to develop using a local TOMCAT environment and then deploy the app to Azure when ready: the developer experience is far better this way.

Comments

  1. I have read your blog its very attractive and impressive. I like it your blo Java Training in Chennaig.

    ReplyDelete
  2. This is my first visit to your blog, your post made productive reading, thank you.
    Java Training in Chennai

    ReplyDelete
  3. This is an awesome post.Really very informative and creative contents.Thanks to sharing these concept is a good way to enhance my knowledge. I like this site very much.I like it and help me to develop my knowledge very well.Thank you for this brief explanation....
    Web Designing Training in Chennai | Dot Net Training in Chennai

    ReplyDelete
  4. Thanks for sharing such a useful information. I am very happy to read your post. It is really very helpful for us and I have gathered some important information from this blog. Hadoop Training in Chennai | Selenium Training in Chennai


    ReplyDelete
  5. Hi, I have read your blog. Really very informative and excellent post I had ever seen about Python. Thank you for sharing such a wonderful blog to our vision.

    Python Online Training

    ReplyDelete
  6. Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!! Java Training in Chennai | Selenium Training in Chennai

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Great post,Thanks a lot for the kind of perfect topic I have not a lot of information about it but I have got an extra unique info in your unique post.
    Back Office Support Services

    ReplyDelete

Post a Comment