Lift & Shift Drupal on Azure Web App for Containers

At the AIS Portals & Collaboration practice, we help many organizations create new experiences with portals to increase their productivity and growth. We also have lift and shift experience where we migrate the existing portals to the cloud—or even architect a custom solution from the ground up, if required.

The Background

The client in this case was an organization that provides financial services to multiple clients and handled multi-billion-dollar assets. This organization had multiple websites running Drupal with a third-party vendor. The vendor provided a custom setup but it was riddled with various issues like slow response, excessive downtime, etc. AIS was engaged to perform a lift & shift operation for their Drupal websites along with a CI/CD setup across multiple environments.

Requirement Gathering

As soon as AIS started the requirement gathering, it was clear that we were going to migrate the websites and databases to a PaaS-based model after initial discussions. Microsoft Azure was deemed the best choice given the plethora of options available for websites, and the customer already had an Enterprise Agreement with Microsoft Azure.

The client had several modifications which required explicit use of Apache Webserver, along with Drush, PHP 7.1 and they needed room for future modifications. People working with Drupal should be quite familiar with that—Drush is often known as the “Swiss Army Knife” for Drupal.

Selecting THE Azure Offerings…

Initially we came up with the following options:

  1. Create Virtual Machines Hosting Web Servers & Databases
  2. Modify the modules requiring Apache and then host the websites on Windows/IIS based Web Apps
  3. Azure Web App for Containers

Option 1 meant that we had to setup the entire infrastructure from scratch. Setting up the infrastructure from scratch wasn’t an issue, but the overhead of maintenance and costs afterwards made us look for other alternatives.

Option 2 required quite some rework, and our previous experience taught us that Drush has hiccups when running on Windows-based hosts.

Option 3 was the best choice because it allowed us to write a custom Docker image with Apache, PHP 7.1, Drush and give the room for future modifications. It was the perfect balance of customization, maintenance overhead and costs. We also got added benefits like:

  1. Automated backups handled by Azure
  2. Continuous Deployment handled by the magic of Kudu
  3. Detailed metrics like Response time, number of requests etc. (Who doesn’t love detailed metrics??)
  4. Auto scaling and lots more!

The Immediate Benefits!

This is the section which should most interest all of you readers. After moving the sites over to Azure, we immediately noticed a huge drop in…

  1. Time to deploy to various environments
  2. Response time. The response time came down to ~350 milliseconds from almost 1 second and above.
  3. The site was overall much faster…and the best part was that the client’s earlier infrastructure had four cores but this new (and shiny!) setup only had two cores and 3.5GB of RAM.

Over the period of almost 20 days, the container served almost 4.6 million requests without breaking a sweat, as you can see from the below graph of CPU/RAM usage:

Figure 1 Mind you, this App Service plan runs another website!

Stay tuned for future blog posts regarding migrating Drupal to Azure experiences and the interesting challenges! Till then, cheerio!