Running ColdFusion in Azure WebApp

This tutorial will show you how to deploy Adobe ColdFusion in an Azure Web App. We will walk through setting up a development environment on a local machine and how to deploy developed ColdFusion site to a Web App. The basic steps are:

  1. Install Apache Tomcat Server
  2. Install ColdFusion JEE Configuration
  3. Deploy ColdFusion *.war file directly to local Tomcat server.
  4. Create a suitable Azure Web App and App Service Plan for hosting ColdFusion server.
  5. Deploy ColdFusion *.war file to Azure Web App.
  6. Develop a local ColdFusion site and use ColdFusion packaging utility to create custom *.war file.
  7. Deploy custom ColdFusion *.war file to Azure Web App.

Some or all of these steps may be useful or relevant for your development scenario. This tutorial uses a Windows machine as installation and development host, but the instructions should be generic enough that they are easily adapted to Linux or Mac hosts.

Installing Apache Tomcat

It is not technically necessary to have an on-premises deployment of Tomcat for running ColdFusion, but in this tutorial I am including one to show that you can have an on-premises development environment and deploy to a similar environment in the cloud. This is a workflow that many are familiar with so I wanted to make sure that is included. To get a Tomcat server up and running quickly:

  1. Download the Windows Service Installer from https://tomcat.apache.org/download-80.cgi (or try a different version if you prefer).
  2. Run the installer and verify that server is running by pointing your browser to https://localhost:8080/

After the installation, you should be able to find the tomcat webapps folder in C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5\webapps if you have installed in the standard location.

Installing ColdFusion JEE Configuration

The installation for installing the JEE configuration of ColdFusion can be found at https://helpx.adobe.com/coldfusion/installing/installing-the-jee-configuration.html. This tutorial installs a 30-day trial version of ColdFusion, which can be obtained from here. In a production scenario, you will need appropriate license keys as indicated in the installation instructions.

  1. Run the installer ColdFusion_2016_WWEJ_win64.exe. Select the following settings:
    1. Select the 30-day trial option (unless you have a serial number):
    2. Select the JEE configuration with the *.war file:
    3. Select Production profile:![CF installer production proile](images/cfinstaller_production_profile.PNG)
    4. Select install location (make a note of where you install):![CF installer location](images/cfinstaller_install_directory.PNG)
    5. For other options, you can just select default values. Create an administrator password and make a note of it.
  2. After installation locate the cfusion.war file. If you picked the default installation location, it should be at C:\ColdFusion2016\cfusion.war. Copy this file to C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5\webapps\ and you should see that the Tomcat server expands the *.war file and creates a cfusion folder.
  3. Point your browser to https://localhost:8080/cfusion/CFIDE/administrator/index.cfm and log in with the admin account that you created during installation. After logging in, the server will finish setup and should redirect you to the administrators interface. You may have to log in again. It should look something like:

Deploying the JEE ColdFusion Configuration in Azure

Please note that when deploying ColdFusion in Azure (or any other platform for that matter) you should make sure that your license covers the deployment strategy that you choose. Azure App Services can automatically scale (up and out) and adding more app service instances may well require you to get more licenses and thus increase costs. In this tutorial we are just using a trial license.  

To set up a Web App appropriate for running ColdFusion:

  1. Create a new Azure Web App with a service plan large enough to support an application like ColdFusion. In my experience, you need at least an S2 plan, but you can experiment depending on the demands of your application:
  2. After the Web App has deployed successfully, go to the settings pane and change it to a Java application with Tomcat:
  3. Validate that the Java webapp is running. You should see something like:
  4. Locate the FTP login details on the overview pane for the webapp:
  5. Use the FTP login details to connect to the webapp (with your favorite FTP client) and upload the cfusion.war file to /site/wwwroot/webapps on the Web App. The process of expanding the *.war file should be similar to the local installation of Tomcat described above.
  6. Give the process a bit of time. (How much time will depend on the performance of the App Service Plan you selected). Then point your browser to the ColdFusion admin interface on the Web App similar to what you did on the local Tomcat server. You should now see the ColdFusion administrators interface in your Web App:

Develop a local ColdFusion Site and Deploy to Azure Web App

  1. On your local Tomcat server create a file C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5\webapps\cfusion\index.cfm with the following content:

    <html>

    <body>

            <cfset message = "World" />

             <cfoutput>Hello <b>#message#</b>!</cfoutput>

    </body>

    </html>

  2. Point your browser to https://localhost:8080/cfusion/index.cfm and you should see your ColdFusion page is working:

  3. You could just FTP this page to your Web App, but we will use the ColdFusion server packaging tool to package your page and the ColdFusion server itself in a single *.war file that you can deploy in a Web App. Follow these steps:

    1. Go to the ColdFusion administrators page and add a new package:
    2. Choose an application director to include in the package. In this case, the directory is C:/Program Files (x86)/Apache Software Foundation/Tomcat 8.5/webapps/cfusion/. You can also decide whether to include data sources and whether the administrative interface should be available:
    3. When the package is done, it should show up in the list of packages:
  4. Upload the generated package to the Azure Web App. You can find it at C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5\webapps\cfusion\WEB-INF\cfusion\packages\cfusion2\cfusion2.war.

  5. After the wait for the unpacking of the *.war file, you should be able to point your browser to your Web Apps new ColdFusion site:

 

That is it, you have deployed ColdFusion on an Azure Web App. Let me know if this is useful to you or if you have comments.