Estimated Reading Time: 4 minutes
Recently I have faced a strange issue with one of the WordPress web app hosted in Azure. It was very strange since some of the other WordPress sites hosted in the same subscription were working fine and the other .net web apps are also working fine.
Since the issue was related to wrong configuration in the WordPress side related to custom domain, before I start more on the detailing of this issue, I would like to show you, how I have initially configured the custom domain for this WordPress site.
Although there are multiple articles in the internet available showing you how to configure your custom domain name with the Azure Web sites, however I will still try to narrate here what I have done to achieve this configuration in simple three easy steps and how I have resolved the WordPress login issue.
Like mentioned in many blogs as well as the Microsoft website I have followed
Go to my web app and check the URL of the website, I’ll try to browse this URL and make sure everything is working fine. Also make I’ll make sure that the pricing tier is correct.
Login to the GoDaddy portal (The custom domain was purchased from GoDaddy) and login to the manage DNS tab and add the following records in the DNS console.
In this step I’ll go the WordPress WebApp and go the custom domains tab and add the domain.
Once the custom domains are added it was looking like this.
Now up to this everything was fine. I was able to browse the site and everything was working as expected. However after few days of operations I have received calls from few users that they were unable to browse the site, when they typed the URL in the below format.
Although the site was opening fine if I type http://customdomainname.azurewebsites.net
Also the WordPress admin has reported that he was no longer able to login to WordPress website with the admin login.
While troubleshooting first, I went to Azure custom domain settings of the WebApp and then went to GoDaddy DNS console to check if any changes were made by anyone and I have found no changes has been done. So this
issue became critical since the WordPress Admin also unable to login to Admin Console
to check any changes.
The application owners and the developers were thinking it was an Azure infrastructure issue. However since no changes was made on the Azure side or the GoDaddy DNS side, I was sure that there must be some changes done in the WordPress application side which must have caused this issue.
While further researching on the issue I came to know that WordPress saves all the settings related to the site in the wp_options table in the MySQL database in Azure. So I have decided to check that database to understand if there is any changes made on the configuration.
I have downloaded MySQL workbench so that I can login to the MySQL database for this website. Now to question is how we can connect to the MySQL database for the Azure WordPress Website.
I have already written an article which clearly explains that how we can connect to the MySQL database in a shared MySQL instance of the WordPress last week.
Please click this article to know more.
Once I login to MySQL database I have ran the following command
And I have found someone has changed the site URL and the Home page URL to customdomain.azurewebsites.net
Because of this change the site is not opening and the WordPress admin was unable to login. I have reverted back the change to the following.
And things started working from there.
The WordPress Admin has send me the screenshot from the WordPress Admin portal and it looks like the below which is expected.
To resolve this kind of issues where multiple parties are involved, it is necessary that the Azure Admin should understand how the Azure Web App works and what are the configuration parameters from admin side. A good knowledge on the administration of the Azure Web Apps can resolve this type of issues faster. For the organizations who don’t have the Azure Administrators they may need to open a ticket with MS for this kind of issues and MS will help in resoving them as per the support agreement, since it’s a PAAS offering they may not charge any dollars but there are different SLA involved which may lead up to 8 hrs. of response time which may be unacceptable for the production workloads.
And I think on premise Web Admins still have many things to do in Azure, if they quickly get trained in Azure technologies it is a good change for their career growth.
I hope you have liked this post. I will publish more on Azure App Services in coming days. Have a good day.