Hosting a WordPress Site on Azure Web Apps
As I am sure you've been able to guess, this site WordPress is hosted on Azure using an Azure Web App with a ClearDB hosted MySQL database behind the scenes. It's fairly straightforward to set this up, but I have found lately that I need to use both Azure Preview Portal and the current Azure Portal for best results. Here are the steps I follow:
-
Create your MySQL database.
I use the Azure Preview Portal for this as the integration with ClearDB is much more complete, in fact, you may not even realize it's a different service provider in the background. I know you are supposed to be able to do this together with creating the "Scalable WordPress" app under "Web + Mobile" , but I find it often doesn't allow you to select the Mercury (free) or Titan ($3.50/mo) pricing tiers for the database. Fill in all the blanks being sure to set the location to the same location that you want to host your WordPress app in. It's good to create a new Resource Group here which will also be used with your Web App.
-
Create your WordPress Web App.
Switch over to the Azure Portal. Reason being: The preview portal doesn't let you select the MySQL database created in step #1. In the Azure Portal, select "Web Apps" and then click the new button. You'll be able to find "WordPress" under the "From Gallery" category. Give it a Url. Under Database be sure to select "Use and existing MySQL database". Select the correct "Subscription" (aka "App Service Plan") under Webscalegroup and the correct subscription under "Subscription" (clear as mud, right?). Lastly there are a bunch of Deployment Settings to complete. These deployment keys can be generated here. As I am sure you have noticed, they cannot be directly copied into the Configure Web App screen in the Azure Portal and even if you could, some of the characters are not valid for Azure. To fix this up, Luis Cantero has published tool to help you out. It can be found at the bottom of his post on this very topic. As his instructions state: "Just paste the entire code from the WP API above and press the button". Simply grab that result from key generator, publish it in his tool, then copy each of the individual keys to the corresponding line in the Configure Web App screen. Once you're done, click the next button (forward arrow), select the database you created in step one, review and accept the term, and click the check button to create your site. It will take a few minutes for the site to create, be patient and then head over to your azurewebsites.net url, run the wizard and you're all done.
Happy Blogging!