Azure is a top cloud vendor offering a wide range of cloud storage services, which you can use to host your WordPress site. This article examines key pros and cons of hosting WordPress on Azure, explains the installation process, and explores four pro tips you can use to optimize your Azure-based WordPress site.
Azure is a platform for cloud computing that is available in software as a service (SaaS), platform as a service (PaaS), and infrastructure as a service (IaaS) formats. You can use Azure to gain access to storage, computing, or networking resources as well as pre-built services like backends for web apps or machine learning tools.
Some of the most valuable features of Azure cloud services include:
- Scalability --- you can manually or automatically scale resources to meet traffic demands and optimize resource use.
- Flexibility --- you can deploy Azure resources with most operating systems, frameworks, and tools. You can also deploy fully in the cloud or in hybrid configurations.
- Reliability --- Azure resources are provided with service level agreement (SLA) ensuring 99.5% availability.
- Global --- Azure provides access to globally distributed resources with data centers available in all regions of the world.
- Cost-effective --- you can use resources and pay-as-you-go, avoiding upfront costs or fees for unused services.
When deciding which provider to host your site with, there are several pros and cons about Azure that you should consider.
The benefits of hosting on Azure resources include:
- Better user experience --- Azure enables you to distribute traffic workloads across multiple resources with low latency. This can help ensure that content loading happens smoothly for all users regardless of how many active requests you have.
- Autoscaling --- your resources can scale up or down as needed. This can help ensure that your services remain available with consistent performance. It can also help you save costs by scaling down when traffic demands decrease.
- Integrated content delivery network (CDN) --- Azure offers a built-in CDN that you can use to cache static, high-bandwidth content. It also includes functionality that enables you to use edge computing for faster delivery of dynamic content.
- Reliability --- any data stored in Azure is automatically replicated across resources to ensure availability and protect you from single points of failure. You can also easily backup data via Azure Backup.
The downsides of hosting on Azure include:
- Price --- Azure works well for enterprise-level sites that require significant resources or bandwidth. However, for smaller sites, the cost is often too high because you cannot benefit from purchasing resources in bulk.
- Database speed --- if you try to host WordPress with the free database option you may not have enough connections or storage. You can upgrade your database and optimize it with plugins but this costs extra. If you do want to go this route, you can use plugins like WP-Optimize which enables you to clear irrelevant data.
- Migration --- if you are currently hosted on-premises or in another cloud, you should keep in mind the complexity of migrating your database to Azure. Migration requires some extra effort but can be made easier with the use of Azure's Data Migration Service.
Once you've decided that Azure is right for your site, or if you want to see what setup in Azure is like, you can take the following steps.
If you are new to Azure you can create a free, trial account to get started. This trial provides 12 months of access to Windows and Linux machines and up to 750 hours of compute time. This is roughly equal to a month of hosting. The trial also grants access to 5Gb of storage, 250GB of SQL database, and 15GB of bandwidth.
After your account is created and verified, you can sign into the Azure Portal. If you already have an Azure account, you can sign in directly.
In the portal, from the main Dashboard, select the + button and choose to create a new resource. You should see a prompt allowing you to search the Azure Marketplace. There you can find pre-built WordPress configurations.
Select the setup you want and click Create.
Select the setup you want
Once your resource is selected you can define your desired configuration. After you are finished, select Create. Options to configure include:
- App name --- a unique name to help you identify your WordPress installation.
- Subscription --- defaults to the account you are currently signed in under.
- Resource group --- defaults to the app name you define.
- Database provider --- should default to Azure Database for MySQL.
- App service plan/location --- select the data center nearest to the majority of your site users.
- Database --- define unique database credentials. It's a good idea to make a note of these in case you need to directly access your database later.
- Application insights --- leave the default value.
From the Azure dashboard, you should be able to select your resource. You'll then see a temporary URL of your WordPress site. Select the URL link to run the WordPress wizard.
Follow the wizard prompts, entering information as necessary. Once you're finished, you can open your site to verify that it's active.
Once your site is operational there are a few practices you can apply to optimize your performance.
- Compress images --- large images consume more bandwidth and can significantly slow your site loading times. Rather than delivering images as is, consider using Azure blob storage to store multiple versions of each file. You can then deliver the optimal image to each device, for example, high-resolution images for users with large screens, and smaller images for smartphones.
- Azure Redis Cache for object caching --- you can use object caching to store query results from your site or web applications. This can help speed your site performance and makes it easier to scale since objects can be delivered from the cache rather than requiring more database traffic. Learn more in the documentation.
- Use Azure CDN --- you can use Azure CDN to automatically check where users are and serve content from the nearest server to them. You can also use the CDN to deliver optimized images or other media. If you're not familiar with CDNs, learn more about how CDNs work.
When hosting your WordPress site on Azure, you gain fast loading speed, autoscaling according to traffic demands, built-in content delivery network (CDN), and high reliability. However, Azure pricing is often too high for users unable to purchase resources in bulk.
Additionally, the free database storage is typically not enough for good speed loads, and upgrading your database will cost you extra funds. To save on bandwidth costs, you can compress images. You can also reduce deployment requests to improve performance, and Azure CDN can automatically ensure users are served optimized content.
--- --- ---
The publication at Meta Box.