Azure Compute

How to Create WordPress site on Azure App Service

Table of Contents

Introduction

In recent times, Microsoft has introduced an easy-to-use solution for WordPress users known as the “Azure WordPress App Service.” This service, which has recently become generally available, allows users to set up a WordPress website on Azure quickly and conveniently. The process involves creating a flexible Azure MySQL database, automatically linked to the WordPress app service. In this article, we will explore the step-by-step process of deploying a WordPress site using Azure WordPress App Service and the benefits it offers to both beginners and seasoned website administrators.

Step 1: Accessing the Azure Portal

  1. Open your preferred web browser and navigate to portal.azure.com.
  2. In the search bar, type “WordPress” and click on the WordPress on App Service option listed under the marketplace.
  3. This will lead you to the Azure WordPress App Service page.

Step 2: Creating a Resource Group

  1. Once on the Azure WordPress App Service page, either select an existing resource group or create a new one.
  2. Choose a region that is geographically close to your target audience to optimize website performance for your visitors.

Step 3: Setting Up the App Service

  1. Give your WordPress app service a unique URL prefix, such as yourwebsite.azurewebsites.net.
  2. Select an appropriate hosting plan; the “Basic” plan should be sufficient, but if you prioritize faster site performance, opt for the “Standard” plan.

Step 4: Configuring WordPress

Provide the necessary information to set up your WordPress site:
  1. Site language: Select the desired site language.
  2. Admin email: Set the administrator email address for your WordPress setup.
  3. Admin username: Set the username for the WordPress administrator.
  4. Admin & Confirm password: Set and confirm the password to be used for the WordPress administrator.

Step 5: Adding Microsoft CDN or Replicating with Blob Storage

  1. Click on the “Advanced” button to customize your site and choose a storage type for static content like stylesheets, JavaScript scripts, images, videos, and other types of files, taking the load off your web server.
  2. To enhance the delivery of your content, it is advisable to utilize Microsoft CDN or Blob Storage region replication. If you opt for Azure AFD, you will need to choose an existing AFD profile or create a new one. For this example, we will select Azure CDN.
  3. Note that if you opt to use Azure CDN, Azure Blob Storage, or Azure Front Door, you need to consider the additional costs associated with these services. Please check the Azure CDN pricing, Azure Blob Storage pricing, and Azure Front Door pricing pages.
  4. Enable Virtual Network for your WordPress app and Storage account private networking, These options allow content to be served closer to your website users, enhancing the overall user experience.
  5. To improve your website’s performance and user experience, consider using Azure Blob Storage.When selecting your Virtual Network, you have the option to either create a new VNet with Azure App Service or choose an existing one, as illustrated in the figure below.

Step 6: Review and Create

  1. Review your selections and configuration details to ensure they align with your requirements.
  2. Click on the “Tags” button to categorize your deployment.
  3. After reviewing, click “Review and Create.”

Step 7: Deploying the WordPress Site

  1. Once you are satisfied with your configuration, click on the “Create” button to initiate the deployment process.
  2. The deployment may take a few minutes to complete.
  3. You will notice several Azure resources created, which were set up and customized to support your new WordPress site. These resources include a MySQL database for WordPress’s flexible server backend, an App Service plan, an App Service resource for hosting the web application, and an Azure Virtual Network for private access to the App Service and the MySQL database, along with a few other resources to ensure everything is set up correctly.

Step 8: Validate the WordPress Site Functionality

  1. Upon successful deployment, Navigate to the created Web App resource that will display the default domain name and other configuration options for the WordPress site.
  2. The default domain name allows access to the WordPress site without requiring any custom domain configuration, which can be set up later if necessary.
  3. Click on your newly created WordPress site’s URL.
  4. Here, you will see WordPress installed and a temporary home page (Hello world!)

Step 9: Customizing the WordPress Site

  1. After a short wait, the WordPress installation will be completed, and you will be presented with your fully functional WordPress site.
  2. Azure provides a custom theme, which you can later replace with a theme of your choice.

Step 10: Accessing the WordPress Admin Dashboard

  1. To access the WordPress admin dashboard, go to yourwebsite.azurewebsites.net/wp-admin.
  2. Use the admin username and password that you provided during the initial setup.
  3. The admin dashboard enables you to customize your site, install and manage plugins, and update your WordPress site effortlessly.

Step 11: Updating WordPress

  1. Updating WordPress is a seamless process.
  2. Click on the “Please update now” link and then select the “Update to version 6.0.1” button.
  3. Azure WordPress App Service will handle the update procedure for you.
  4. By default, the WordPress on Azure App Service team has included the following three WordPress plugins for you:
    • W3 Total Cache: We use this plugin for Redis cache and to enable integration with Azure CDN and Blob storage.
    • Smush: We use this plugin for image compression.
    • Akismet: This plugin helps in protecting your website from malicious content.
    • W3 Total Cache CDN setting will be configured automatically and an Azure Storage account will be attached to host the Website object.

Step 12: Accessing phpMyAdmin for Database Management

  1. Azure WordPress App Service allows you to access phpMyAdmin, the MySQL administrator portal, directly from your app service URL.
  2. Simply append “/phpmyadmin” to the URL and use the MySQL admin username and password to log in.
  3. This will enable you to manage and modify your WordPress database as needed.

Step 13: Configure Custom Domain on WordPress Site

While you could host your website with the default domain name and the subdomain .azurewebsites.net of the Azure App Service. However, it’s recommended to purchase a domain name from your favorite domain registrars such as GoDaddy or Cloudflare to host your WordPress site instead. If you don’t have a custom domain yet, you can purchase an App Service domain directly from Azure. To configure a custom domain for your WordPress site on Azure, follow these steps:
  1. Navigate to the Custom Domains pane under Settings of the App Service resource created for your WordPress web app.
  2. Select ‘Add custom domain’ to configure your own custom domain for the WordPress site.
  3. To configure a custom domain for your WordPress site on Azure, follow these steps On the “Add a custom domain” page:
    1. Set the Domain provider to “All other domain services.”
    2. Choose “App Service Managed Certificate” for TLS/SSL certificate.
    3. Select “SNI SSL” as the TLS/SSL type (recommended for free and supported by most modern browsers).
    4. Specify your fully qualified domain name (e.g., wpapp.3tallah.com) based on the domain you own.
    5. Don’t validate yet. The Domain validation section will show you two DNS records that
    6. You must add with your domain provider.
  4. Sign in to your domain registrar’s website and find the page for managing DNS records.
  5. Create two DNS records (CNAME or TXT) based on the information provided in the Domain validation section in the Azure portal (Host and Value columns).
  6. Once you’ve added the DNS records on your domain provider’s side, go back to the Azure portal’s “Add Custom domain” page and select “Validate.”
  7. Check the Domain validation section to ensure that both domain records show green check marks under the Status column, indicating successful configuration.
  8. If any red X appears, fix the errors in the DNS record settings on your domain registrar’s side.
  9. After successful validation, click “Add” to add the custom domain to the list.
  10. Wait for a few minutes to let App Service create the managed certificate for your custom domain. Once complete, the red X will become a green check mark, indicating a secured connection.
  11. SSL Binding will be initiated automatically and your custom domain certificate will be configured
  12. Finally, browse to your WordPress custom domain to access your site.
Congratulations! You have successfully configured your custom domain for your WordPress site on Azure.

Step 14: Managing Docker Image Hosting

  1. Your WordPress site’s images are hosted as a Docker image in a private Azure Docker registry.
  2. You can manage these images conveniently through the app service’s application settings.

WordPress Features on Azure App Service

In addition to the Azure services mentioned earlier, the WordPress on Azure App Service team at Microsoft has implemented the following features to enhance the WordPress hosting experience:
  1. Updated Technology Stack:
    • Automatic updates for Linux, PHP, and Nginx are provided to keep the technology stack up-to-date.
    • New WordPress versions are made available for new deployments within two weeks of release.
    • For existing deployments, you will need to manually upgrade your WordPress version.
  2. Out-of-the-box Redis Cache Implementation:
    • The offering includes an out-of-the-box implementation of Redis Cache in the Web Server, which improves performance and reduces the load on the database.
Azure App Service Hosting Plans: Microsoft Azure offers three hosting plans for you to choose from based on your WordPress requirements:
  1. Basic (B1):
    • WebApp Server: 1 vCore, 1.75 GB RAM, 10 GB Storage.
    • MySQL Flexible Database Server: 1 vCore, 2 GiB RAM, 32 GiB storage, 400 IOPS.
  2. Standard (P1V2):
    • WebApp Server: 1 vCore, 3.5 GB RAM, 250 GB Storage.
    • MySQL Flexible Database Server: 2 vCores, 8 GiB RAM, 128 GiB storage, 700 IOPS.
  3. Premium (P1V3):
    • WebApp Server: 2 vCores, 8 GB RAM, 250 GB Storage.
    • MySQL Flexible Database Server: 2 vCores, 16 GiB RAM, 256 GiB storage, 1100 IOPS.
For more information about the estimated cost, you can refer to the App Service Plan pricing and Azure Database for MySQL pricing pages for your specific WordPress project. These hosting plans allow you to select the appropriate resources and performance levels based on your website’s needs.

Conclusion

The Azure WordPress App Service streamlines the process of deploying and managing a WordPress website, making it accessible to both novices and experienced website administrators. By following the steps outlined in this article, you can effortlessly create a fully functional WordPress site on Azure with just a few clicks, without any coding required. Embrace the power of Azure WordPress App Service to quickly launch and maintain your WordPress websites with ease.
Mahmoud A. ATALLAH

Microsoft MVP | Speaker | Azure Service Delivery Lead at Bespin Global MEA, helping customers build successful Azure practices. Talks about #AzureCloud and #AI

Recent Posts

Gitex – Ensuring a Secure & Scalable AI-powered Solution with Azure

In this session, we will explore the architecture and best practices for building secure and…

2 months ago

Part 4: Data Exfiltration Playbook – Azure WAF Security Lab

Introduction Welcome to our comprehensive series on Azure Web Application Firewall (WAF) security! In this…

4 months ago

Part 3: Vulnerability Exploitation Playbook – Azure WAF vs XSS

Introduction Welcome to the third installment of our Azure Web Application Firewall (WAF) Security Lab…

4 months ago

Part 2: Reconnaissance Playbook – Testing Azure WAF Protection

Introduction Welcome to the second installment of our Azure Web Application Firewall (WAF) Security Lab…

5 months ago

Part 1: Lab Setup – Building Your Azure WAF Testing Environment

Introduction Welcome to the first installment of our four-part Azure Web Application Firewall (WAF) Security…

5 months ago

Azure Web Application Firewall: A Hands-on Security Lab Series

Introduction In today's digital landscape, protecting web applications from sophisticated attacks is crucial. Azure Web…

5 months ago