Azure App Service : Deploying a java webapp (geoserver) to Azure

Introduction

For today’s post, we’ll be deploying a java web-app to Azure. Here we’ll be leveraging our well-known “App Service” as the underlying PaaS component to host our web-app.

 

Sample Workload : Geoserver

For today’s example, we’ll be using “geoserver” as the grounds for our little proof-of-concept. In addition, we’ll even trow in the Azure PostgreSQL Database for the back-end store.

 

Prereq.

In advance, I already did the following ;

  • Create an Azure Web-app via the following template
  • Created an Azure PostgreSQL Database

Now let’s get to it!

 

Step-by-step

First we’ll start by downloading the web archive for geoserver ;

Whilst downloading, we’ll setup the deployment credentials ;

And we’ll use those to FTP into the file system powering our web-app ;

Here we’ll upload the “geoserver.war” and after a while, Tomcat will pick it up and start unpacking it! And if you even give it a tad more… Then we’ll see that the web-app was deployed and reachable!

Now let’s take a look at the security settings of our PostgreSQL…

It seems geoserver isn’t a fan of security, as SSL isn’t supported. So we’ll need to disable SSL enforcement. Don’t forget to configure your firewall! In my example, I just opened it up to the whole wide world, though you can limit it to the IPs of the App Service (hardening). You can find these in the properties of your web-app ;

If you forgot to disable the SSL enforcement and align the firewall, then you’ll probably get the following error when creating the postgis store ;

On that area, it’s good to know that there are a bunch of PostgreSQL extensions readily available ; postgis is one of them!

 

Closing Thoughts

One of the key missions of Azure is to be an Open Cloud. Today we saw how we can leverage geoserver, as a typical java web-app deployment, to showcase that deploying it to Azure is pretty straightforward!

 

4 thoughts on “Azure App Service : Deploying a java webapp (geoserver) to Azure

  1. Thanks for the article. Took me a while to figure this out. Actually, you can use SSL. In Geoserver, in the database name field, you can do the following:

    mydatabase?ssl=true&sslfactory=org.postgresql.ssl.SingleCertValidatingFactory&sslfactoryarg=file:/home/certs/BaltimoreCyberTrustRoot.crt.pem

    You can get the certificate from: https://docs.microsoft.com/en-us/azure/postgresql/concepts-ssl-connection-security#applications-that-require-certificate-verification-for-ssl-connectivity

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.