This blog explains in a step-by-step how to install (fresh install or migrate) a Magento package into Azure websites

Background

1. What is Magento?
Magento is an eCommerce software platform used by some of the world’s leading brands. More details could be found here on Magento.

2. Why install Magento on Azure?
There is a long list of reasons of why would somebody wants to migrate to the cloud, but few of these reasons could be 1) Cost saving 2) Load Balancing 3) Scalability 4) Less maintenance.

The Problem

Why do we need to install Magento on Azure Websites?

The current Gallery of applications on Azure Websites has a limit number of apps that can be installed out-of-the-box. This means that a long list of apps cannot be installed directly from the Azure App Gallery.

To get around this, the current solution is to install these apps on their own Virtual Machine. A Virtual Machine (VM) image for Magento is posted by the Microsoft Open Technology team can be found here.

However, having a dedicated VM means that you need to consider the maintenance that comes with it, the security of the VM, and many other factors that makes VMs cost more to maintain than Azure Websites.
So, what should we do, how can we install Magento on Azure Websites?

The Solution

You can do the installation manually. Azure Websites have PHP 5.4, Python, Java and other languages setup and enabled for you by default. See image below.

Azure-websites-languages-enabled-by-default

This means that you can install most Open Source software and they should work fine. One thing that you need to consider is whether the package or the framework was designed to work in a cloud environment or not.

For instance, if a framework relies heavily on the Linux file system and stores files for session state and other components, this app might not work properly in a cloud-based environment.

The good news is that Magento and most other open source apps are designed to work in the cloud. So to install an open source package (Magento), you should follow the steps below:

1. Create an Azure Website
There are many tutorials and blogs that cover how to creating a website using Azure Websites, so I will not go to the details but I would assume that you have a subscription and you have an Azure Website created.

2. Check the Magento requirements on Azure Websites
Magento has a small PHP page that checks the specs of your server and reports back on whether your server is Magento-capable or not. This page can be found on the Magento installation guide here.

Download this page, install it on your Azure website root directory and navigate to the webpage (i.e. magentotest.azurewebsites.net/test.php) assuming that you named your php page as test.php.

This web page should report back that all packages are there, except MySQL server, because it expects the database on the same server. If you need to add extensions or libraries for other Open Source packages, you could do that, see this page.

3. Download and Unzip Magento package files
Magento supports downloading the files directly to Azure Websites via the downloader (see the installation guide), but for this tutorial, we are going to download the package (you can get the download from here), unzip it locally, then upload the files to the Azure Websites via FTP.

If you have not done that before, again there are quite a few tutorials online that shows how to deploy a site to Azure Websites via FTP. Azure Websites provides you with a Publish Profile, you could use that to ftp-connect to your site.

4. Create MySQL database on Azure
We need to create a MySQL database for Magento. If you are migrating to Azure, you might want to back up your database and restore it on Azure. The bottom line is that we need a MySQL database that is accessible from the Azure Website. Azure’s MySQL hosting options involve either running MySQL on a Virtual Machine or purchasing an Azure PaaS offering from ClearDB. You will need the Hostname, Username, and passowrd handy for the Magneto installation wizard.

5. Install Magento through the Wizard
Once you have the Magento package deployed, and you have your MySQL database ready, all we need is to go through Magento installation wizard. Once you navigate to the base URL (i.e. magentotest.azurewebsites.net/) then Magento is going to detect that you have not done the installation yet, and you will be taken to the installation wizard (shown below).

Follow the wizard and provide the database details, and you should be done.

magento install wizard

Conclusions

Although this post shows how to install Magento on Azure Websites, you could effectively use this same approach to install most of other Open Source packages on Azure Websites.

I hope this would help somebody out there, and please do let me know via the comments if you have any questions.

Category:
Application Development and Integration, Azure Infrastructure, Azure Platform, Cloud Infrastructure
Tags:
,

Join the conversation! 9 Comments

  1. Thank you. When you scale the website to multiple VMs, will the FTP root files be on the second server automatically, or do you have to copy these over to each instance manually via FTP?

    Reply
  2. Have you tried to deploy WordPress using a website instance and connect to a VM running MySQL?

    Reply
  3. Thanks for the post . So looking at the way the website is setup in Azure it gives a subdomain as part of the azure framework of azurewebsites.net. What if I want my own domain? How can that be achieved? Thanks
    Dev

    Reply
  4. This is an awesome explanaition, but since this year Magento is available in windows azure web site gallery.

    https://vmdepot.msopentech.com/List/Index?sort=Featured&search=magento

    Reply
  5. is to utilize the Kudu Diagnostic Console that features every Azure website to download and install Magento directly to my website and unzip it.

    Reply

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: