#WordPress to #Jekyll Part 5 - Hosting on #Azure Websites

Although hosting your blog in GitHub Pages is very easy to setup, it lacks several features provided by other hosting services like SSL certificates. I have decided to introduce Azure Websites as an alternative because it offers a wide range of hosting options including FTP uploads and server-side code. In addition, Azure Websites can be connected to a source control system to update the hosted content based on changes in the source. This post will demonstrate two important deployment methods.

FTP Upload

The easiest method for publishing content on a webserver is using FTP to upload the necessary files. Before you are able to connect using FTP you need to set the deployment credentials using the Deployment credentials located in the section called Publishing.

Afterwards you can use any FTP client to place your content there:

FTP Upload for Azure Website

In the context of static site generators, you simply need to upload the generated files. Jekyll places the resulting files in a directory called _site. Read more about Jekyll in one of my previous posts.

This method can also be automated using your favourite scripting language.

Using Continuous Deployment

Although it is rather straight forward to upload content, Azure Websites can be connected to a source control system like GitHub to pull the content from a repository whenever changes are committed.

I have created a repository on GitHub named dille.azurewebsites.net containing all files resulting from my Jekyll based blog. It represents a copy of the directory called _site. This repository is used for my Azure Website called dille.azurewebsites.net.

To connect your Azure Website to a GitHub repository your need to navigate to the settings and select Deployment Source located in the section called Publishing:

Settings for Azure Website

Then choose a deployment source, for example GitHub:

Choose deployment source for Azure Website

Before your Azure Website is able to pull content from a repository, you need to authentication, provide a repository name and a branch:

Setup continuous delivery for Azure Website

After the configuration is completed successfully, the content will be pulled from your repository for the first time. This task is queued:

Waiting for deployment

When the deployment begins, the Azure Portal will keep you updated:

Deployment in progress

As soon as the deployment is completed, the portal will update and your site serves the content of the configured repository:

Deployment is active

Whenever you decide to update the repository configured for your Azure Website, it will be informed through a web-based API and schedule a new deployment:

Waiting for new deployment New deployment in progress New deployment is active

Although Azure Websites does not offer a static site generator, it is able to automatically update from a repository containing the resulting site.

Summary

After I have argued for a static site generator and explained how Jekyll works, I have presented two hosting options. GitHub Pages integrates with Jekyll to make your life easy but is missing features typically found in hosting services. Azure WebSites can be connected to a source control system to update its content automatically but does not offer an integrated static site generator. Jekyll has become a very popular static site generator so that migrations from WordPress are very easily achieved.

In one or more additional articles, I will present customizations to a Jekyll based blog. This includes social buttons, search and analytics.

Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.