Blog Archive

Migrating a WordPress Site to Azure

There are a number of choices for hosting a simple website at little or no cost (other than the domain name registration).

I used Azure with years ago but when I wanted to secure my site using HTTPS the cost of the hosting plan was too high. I moved to GoDaddy but their low-cost plans at the time used an older version of PHP which caused my site to fail the UK government Cyber Essentials security certification. It was not possible to update the PHP version due to being on a shared hosting plan. I must admit I was shocked that the GoDaddy support team knew about this vulnerability which affected many customers and still had no timeline to update their hosting.

So I moved to but recently moved the site back to Azure as I can tie it into a subscription offer I have for Visual Studio, so the hosting, although more expensive than, effectively costs me nothing whilst I have Visual Studio. This applies only to dev/test sites and resources, not production sites.

The first step was to create a WordPress for Linux app service on Azure. I’m using app service plan S1 which provides features I require such as daily backups and SSL. I ensured both the source and target WordPress sites were updated to the latest version of WordPress. I installed the All-in-One WP Migration plugin onto both the guru and Azure sites. This tool migrates the entire site and is free if your site export squeezes in at under 512MB and you export/import via a file.

The migration worked well (surprisingly) and the imported site on Azure behaved as it should. It’s only a simple site which can now be accessed through But there were a couple of issues to address.

The Domain Name

I want my site to be accessed through, not Although I have seen several organisations use that DNS for their sites, I think it’s very unprofessional.

In the Azure blade menu for my app service, I click Custom Domains and I can add a custom domain which I registered. Use * so links to both and just will work.

Azure Custom Domains

You’ll need to go through the process of proving ownership of the domain and that is explained well enough in the documentation.

Once you’ve done that, the custom domain will be listed and you can now navigate to your Azure hosted site using your own domain name. However, it won’t be secure.

The SSL Certificate

I want to secure my site so it can only be accessed through HTTPS. To do that I need to set up a certificate. I have the domain registered through and the registration includes a free wildcard SSL certificate. I want to bind this to * in order for both and to be secure.

Through the Ionos control panel for my domain, I could activate my certificate (providing me with a private key) and create and download a .PFX file using that private key.

Back in the Azure portal for my app service, I can click ‘Add binding’ next to my custom domain name and upload the new .pfx I just generated. I can set IP SSL binding or SNI SLL binding. After reading up a little on those, I chose SNI binding but I’m not a security expert so do you own due diligence as to which you choose.

Now my site is secure. If I type in or or I’ll be redirected to my Azure hosted site on HTTPS and I get the nice little secure padlock in the address bar with my certificate details.

The WordPress Site Health Report

I decide to run a WordPress Site Health report on my shiny new site. It came up with a few deactivated themes and plug-ins I should delete and also that my version of PHP was out of date.

Usually, you can update the platform through the Azure portal by going to the Configuration blade for the app service and selecting the General settings tab. But the blade for my app service didn’t list the stack settings. Puzzling.

The PHP Version

A bit of digging bought me to this blog page which described the same problem and the solution.

The WordPress for Linux app service template is maintained on GitHub and based on a Docker container with alpine linux and a specific version of PHP. This clearly doesn’t get updated as frequently as new PHP versions are released. Still didn’t explain why the Azure portal doesn’t show the stack settings.

This document details the CLI commands to run in order to view and update the PHP version on the app service. And once you’ve done that, not only does it keep WordPress Site Health happy, the stack settings now appear in the Azure portal.

Azure app service stack settings

So the world is good, my site has migrated onto Azure and it can be securely accessed through my custom domain name.