Jump to content

Steps to install Drush on Azure App Service.


Recommended Posts

Guest vinku85
Posted

Managing a Drupal website can be time-consuming, especially when it comes to updates, backups, and deployments. This is where Drush comes in. Drush is a command-line interface (CLI) tool for Drupal that makes managing your Drupal website faster and easier.

 

 

 

In this blog post, we will take a closer look at how to install Drush along with Drupal in Azure App Service.

 

 

 

If you wanted to know how to migrate an existing Drupal site to Azure App Service please refer Easy way to migrate an existing PHP site with MySQL to Azure App Service. - Microsoft Community Hub.

 

 

 

Please use following steps in order to install Drush on Azure App Service:

 

 

 

Step 1:

 

Go to your KUDU console http://<yoursitename>.scm.azurewebsites.net/newui (replace "yoursitename" with your actual Web App name) through the browser or you can search Advanced Tools & click on Go button as shown below from Azure portal:

 

 

 

806x147vv2.png.e278f6beb72dd38e4449591b8bc708b3.png

 

 

 

Step 2:

Select WebSSH on the Kudu page to enter into the app container.

 

Create a directory called ext inside your /home/site folder & download composer.phar by running the following commands:

 

 

 

 

 

 

 

mkdir /home/site/ext

cd site/ext/

curl -sS https://getcomposer.org/installer | php

 

 

 

 

 

 

 

832x335vv2.png.1d0727ba5c2996845e326352f4b5be08.png

 

 

 

Step 3:

 

Add the composer into /usr/local/bin/composer to access composer globally and install Drush using command under /home/site/wwwroot directory:

 

 

 

 

 

 

 

cp /home/site/ext/composer.phar /usr/local/bin/composer

cd /home/site/wwwroot/

composer require --dev drush/drush

 

 

 

 

 

 

 

857x135vv2.png.1e70c47b75cfadf1ed473476e73f4554.png

 

 

 

Step 4:

 

Create the startup.sh file under /home/site folder and add the following script.

 

 

 

 

 

#!/bin/bash

cp /home/site/ext/composer.phar /usr/local/bin/composer &&

echo 'export PATH="/home/site/wwwroot/vendor/bin:$PATH"' >> ~/.bashrc &&

sh ~/.bashrc

 

 

 

 

 

 

 

Step 5:

Now provide the startup.sh file in App Service Application by selecting Configuration blade & then selecting General Settings and adding following command (/home/site/startup.sh) under Startup Command as shown below:

 

 

 

916x339vv2.png.48d8e0a561e4289e4035540246fbab4f.png

 

 

 

After restarting the Azure App Service, you can access Drush in Kudu console & all changes made to application inside /home directory will persist.

 

 

 

930x293vv2.png.be97467678021c48a74dfcb57886b154.png

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...