Microsoft Azure Open Source Development Support Team Blog

Support for Open Source Technologies on Microsoft Azure App Service

Restrict access to login for the WordPress running on Azure web app container

For WordPress sites that running on Apache server in Azure web app for containers, here is sample code to restrict access to login pages, such as wp-login.php or wp-admin 1. FTP to files in /home/site/wwwroot, find the file “.htaccess” (create one if it does not exist) 2. Add the code below to “.htaccess”, replace the… Read more

RewriteRule sample for WordPress in subdirectory

In the case you installed another instance of WordPress in a subdirectory of main WordPress site in Azure web app for Windows, your WordPress installation may be like this,   if use “Post name” Permalink setting, with default web.config, articles in subdirectory might give 404 (not found), for example,   For this problem, you can… Read more

HTTP to HTTPS redirect for WordPress on Azure Web App on Linux

If you host WordPress site on Azure Web App on Linux running Apache, here are the steps to implement HTTP to HTTPS redirect: 1. Add RewriteRule in .htaccess in WordPress application root RewriteCond %{HTTP:X-ARR-SSL} ^$ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 2. Once this RewriteRule is added, you may see wp-admin page lost style like this, this… Read more

Migrate WordPress content to Azure blob storage

Azure storage provides solution for applications requiring scalable, durable, and highly available storage for their data. In this blog, we cover the steps how to migrate existing WordPress content from file system to Azure blob storage. 1. Create storage blob Create an Azure storage account Create blob storage Create a blob container to store the… Read more

Best Practices for WordPress Security on Azure

This article was put together by Mangesh Sangapu and Yi Wang. Shout-out to Cory Fowler and Sunitha Muthukrishna for additional tips. WordPress Security is often an overlooked feature. Customers are quick to configure their site, but often forget to fine tune the security aspect. Here we have compiled steps that will help make your WordPress site… Read more

WordPress: Redirecting to wrong URL!!

Problem: While trying to browse to, it keeps redirecting to!!   Redirection Scenarios There are a couple situations where one may face the WordPress Redirection issue: Migrated from another host Changed your custom domain name and it’s going to your old domain!   Understanding The Issue This redirection can occur for two reasons: URL… Read more

Triggering the PHP Process Report on Azure Web Apps

The PHP Process Report can be a vital tool in troubleshooting slowness or errors with your PHP Web Application. This article covers how to trigger the report based on a rule. Reference Apurva Joshi has a great article on Diagnostics as a Service (DaaS) for Azure Websites located here: Details on the Azure Web… Read more

WordPress: Error establishing a database connection

If you see the infamous “Error establishing a database connection“, enable WordPress Debug Logging by following the steps outlined here:     Debug.log will be saved within wp-content folder. Possible error messages in debug.log: [25-Jul-2016 15:34:44 UTC] PHP Warning: mysqli_real_connect(): (HY000/1045): Access denied for user ‘be96d626d450b1’@’’ (using password: YES) in D:\home\site\wwwroot\wp-includes\wp-db.php on line 1490 [25-Jul-2016 15:34:44… Read more

Enable WordPress Error Logs

Logs can help identify slowness, HTTP 500 Fatal Errors,  WordPress “white screen of death” and other issues your Azure App Service Web App may be experiencing. To enable error logging in WordPress, you will have to make both of the following changes.  Quick Instructions   .user.ini Within wwwroot directory, create a file named .user.ini Add the following… Read more

Giving your existing WordPress MultiSite a new domain name on Microsoft Azure

Prerequisites:  This article assumes you acquired a new domain name and have configured the DNS Zones. If you haven’t already done so, see the article here: Configuring a custom domain name for a Microsoft Azure Web Site   Problem: You installed WordPress through the MS Azure Gallery and setup a MultiSite (WP feature). However, now… Read more