In this article, we are going to deploy WordPress in Azure. Therefore, we are going to set up an Azure Web App, where WordPress will be installed. The database is going to be created using Azure Database for MySQL.
To get started with Azure Database for MySQL, you’ll need an Azure subscription. If you don't have one, you can create a free Azure account before you begin.
Create a new server
The first step is to create a new server. We are going to do this from the Azure portal.
- Open a web browser and navigate to: https://ms.portal.azure.com
- In the top-right menu, select + Create a new resource, and in the search box type WordPress on Linux and click Create.
- A new blade will be opened where you can specify the details and pick the Azure Database for MySQL for data storage. Add the following values:
- App name: WordPressdemo12
- Subscription: Select a subscription
- Resource Group: Create a new one. This will be the container where all the different artifacts will be created.
- App Service Plan/Location: Select this and create a new one. These settings are for the Web App. You can also select different pricing tiers in here
- Database provider: Azure Database for MySQL.
- Click OK.
- Database: Here, you need to provide the Server name, Server admin login name, password, and the PHP version:
- To select a different pricing tier for the database, click Pricing tier. You can then choose the tier and the vCores, database capacity, backup retention period, backup redundancy options and more, according to your needs:
- Database name: Provide a new name or keep the default one. Click OK.
- After that, click Create.
- A new MySQL server and Azure Web App will be created. WordPress will be deployed on it.
Configure WordPress
After five minutes, the WordPress instance will be created. You can navigate to the website, by copying the URL from the overview blade:
- Paste the URL in a new browser window. The WordPress configuration page will pop up:
- Select the language and click Continue.
- Add the site values to it, such as the following:
- Ensure, that you copy the username and password. You need this when you sign in to the WordPress site after installation.
- Click Install WordPress. You don’t have to provide any database settings or credentials; these are automatically configured when we create the WordPress and database instance in the first part of this demo.
- When WordPress is installed, you will see the following response. From there, you can sign in to the WordPress site with the credentials that you have specified in the previous WordPress configuration screen.
- You can now use WordPress for creating your website, blog, or other type of site.
Summary and next steps
In this article, we created a WordPress site on Azure using Azure App Service and Azure Database for MySQL. Azure handles a lot of the configuration steps for you automatically during deployment, which makes it extremely easy to create highly available, scalable, and secure WordPress sites for your users. There are also additional steps that you can take to speed up your WordPress sites—for instance, optimizing your database by storing media content in Azure Blob Storage or compressing images. You can also use a CDN for storing static content for your WordPress site. For more information about Azure Database for MySQL and additional services and features, you can refer to the following links:
- Get started with the service by creating your first Azure Database for MySQL server using the Azure portal or Azure CLI.
- Learn more about read replicas and how to create them in the Azure portal or Azure CLI.
- File feature requests on UserVoice.