Locked out of a Wordpress Azure Web App?

Azure provides a hosting service, known as Web Apps, where you can easily deploy  applications such as WordPress, with almost one click, saving you all the brunt of installing and configuring the entire machine yourself. This is all and good, especially for the non-engineer who does not need to know what is happening behind the scenes - just log into your WordPress and focus on content management.

The problem arises when for some reasons, you get locked out of WordPress, for example due to a bad plugin installation, or even worse, a security breach. A lot of people just give up and spin a new Web App, which might work if you have a simple site with simple backup/restore mechanism. 

But if you want to actually log inside the machine and take a look to remove the offending plugin or issue?

Fear not, Azure provides an SSH option to your Web App! 

The SSH option can be found in your Azure Portal dashboard under Development Tools. Once you click this option, you will be redirected to a web ssh terminal and automatically logged as root. Since you are in root, you need to be extra careful. 

Next step is to locate the WordPress root folder which can be found inside /home/site/wwwroot/. 

# cd /home/site/wwwroot/

From there you can easily troubleshoot, delete or move around your faulty plugins.