Skip to main content

Microsoft Developer Tour in Minsk. Report "Deployment and management of CMS Drupal in Microsoft Azure"

Submitted by admin on

On March 21, 2015, the vmn.by team took part in the Microsoft Developer Tour conference, which was held at the Renaissance Minsk Hotel.

In this article, we will take a closer look at the possibilities of integrating CMS Drupal with Microsoft Azure and how to manage a site using the Drush tool.

Initially, with the launch of Windows Azure in 2010, the Drupal CMS was introduced into the Azure WebSites cloud service, with which you could create a new site with a standard set of modules in a few clicks. Currently, this process is so debugged that it takes no more than 5 minutes.

The Drupal.org community now supports 2 branches of the content management system - CMS Drupal 7 (current version 7.35) and CMS Drupal 8 (current version 8.0.0-beta9), which should be released soon.

It should be noted that Microsoft Azure supports both 7 and 8 versions of CMS Drupal.

Ways to deploy Drupal CMS on Microsoft Azure

Using Microsoft Azure, you can go in several ways, namely, use the choice of Microsoft Azure Websites (PaaS) or Microsoft Virtual Machine (IaaS).

Способы развертывания CMS drupal в Microsoft Azure

In the first case, you are provided with a ready-made service with an installed IIS8 web server with the ability to use .NET, Java, PHP, Node.js, Python programming languages, an autoscaling function, and support for various code deployment tools. In the second case, you are provided with an infrastructure with which you can independently create your own server with installed Windows Server, Linux or Oracle software.

1. Microsoft Azure Websites (PaaS)

  • deploy CMS Drupal in Azure WebSites using MySQL database (domain_name.azurewebsites.net)
  • deploy CMS Drupal in Azure WebSites using MSSQL database (domain_name.azurewebsites.net)

2. Microsoft Virtual Machine (IaaS)

  • deployment of a virtual machine with Drupal CMS with VMDEPOT image (versions Drupal 8.0.0.beta7, Drupal 7.35)
  • deployment of a virtual machine based on Windows Server 2012 or Linux with the installation of CMS Drupal (domain_name.cloudapp.net)

We will briefly review the possibilities of deploying CMS Drupal using each of the services.

One of the main advantages of Microsoft Azure Websites is the ability to publish your source code through various version control systems and various software - Visual Studio Online, CodePlex, Git, GitHub, BitBucket, DropBox, FTP.

Quickly create a Drupal site from a collection of web applications

Быстрое создание сайта CMS drupal в Microsoft Azure

To quickly create a site in Microsoft Azure WebSites, you need to have your own account in the outlook.com mail system. After that, you need to go to the Microsoft Azure portal at manage.windowsazure.com and at the bottom of the screen click Create -> Website -> From Gallery.

Сборки Drupal в Microsoft Azure

You can choose from 3 types of ready-made applications - the Acquia Drupal 7 build, the Drupal Commerce Kickstart e-store build, and the build based on NuData DKAN open data.

Новая база данных Mysql в  Microsoft Azure

After choosing the Drupal CMS version, you need to come up with a site name (domain_name.azurewebsites.net) and select a database from the list:

  • MySQL database (20 Mb free service ClearDb)
  • Free SQL database (20Mb)
  • SQL database (from hosting plan)

And select the region where the database is located.

Успешное создание сайта

To set up a MySQL database, you must specify a host name and region.

After that, the process of automatic installation and site configuration will begin.

Настройка параметров сайта Drupal в Windows Azure

After we go to the created domain and click "Next" to the item "Site Information". Here we fill in the following items:

  • E-mail address of the site
  • Username
  • Password
  • Timezone
  • Automatic module updates (notifications)

That's all, for this we have created a ready-made site on CMS Drupal 7 in the Microsoft Azure WebSites cloud service.

Migrating Drupal CMS site to Azure WebSites

If you already have a ready-made site on your local computer, then we perform similar steps:

1. Create a new Azure Web Site and MySQL database

2. Import the database in MySQL to the Azure website using the command

mysqldump -u local_username --password=local_password drupal | mysql -h remote_host -u remote_username --password=remote_password remote_db_name

3. Change the database connection string

/site/wwwroot/sites/default/setting.php

4. Host Drupal code using Git or FTP

Git: http://azure.microsoft.com/en-us/documentation/articles/web-sites-php-mysql-deploy-use-git/

Using Virtual Machines to Deploy CMS Drupal

Here, the user has an order of magnitude higher opportunities than when using the Azure WebSites service.

1) We can choose a ready-made virtual machine based on Windows Server 2012 R2, Ubuntu Server 14.04 LTS, CentOS 6.5, SUSE Linux Enterprise Server, openSUSE 13.1, Oracle Linux 6.4.0.0.0

2) Use a ready-made virtual machine image with preinstalled software (CMS Drupal 7-8, MySQL, PhpMyAdmin - https://azuremarketplace.microsoft.com/ru-RU/marketplace/apps/category/compute 

3) Use ready-made virtual machines from the Azure Marketplace service (portal.azure.com):

- Drupal 7 (Ubuntu 12.10)
- Drupal Commerce Kickstart
- Drupal 7 LAMP Server on OpenLogic CentOS 6.3
- Drupal + Odata
- Linux Chef
- CiviCRM
- NuData DKAN

Сервис Kudu в Microsoft Azure

Installing Drush on Windows Azure Websites

Installing Drush on Windows Azure Websites

Установка Drush в Microsoft Azure

Installation process:

1. Copying Drush to the root folder of the project (http://www.drush.org/en/master/)

2. Installing the Composer tool through the specialized Kudu service (https://drupal701.scm.azurewebsites.net) and updating all dependencies for Drush.

update composer command

3. Check Drush configuration via Debug Console -> CMD: drush status

Установка Drush в Microsoft Azure

In the Azure portal app settings, enter data: COLUMNS with parameter 80

4. Azure Drush command examples

drush help (all commands drush)

drush pm-update drupal (kernel update CMS drupal)

drush cache-clear (clear cache)

drush vset theme_default theme_name (Set the default theme for your site)

drush pm-update <modulename> (update drupal module)

drush archive-dump –-destination=<destination path> (make a website backup)

drush en <modulename> (enable module)