Azure

Hidden feature of the Azure Portal: keyboard shortcuts

keyboard

Last week, we released a new version of the Azure Portal (v5.0). There is a lot of improvements in the portal, but I would like to focus on particular one: the keyboard shortcuts. Check it out!

Hubs (left menu) shortcuts:

H – show startboard

N – open Notifications hub

A – open Active journeys hub [journey is the currently opened group of blades; blade is card/tab/subpage that contains some group of tiles, e.g. website properties or analytics]

/ – open Browse/Search hub

B – open Billing hub

C – open Create/New hub

Azure Portal keyboard shortcuts: hubs

Changing focus between blades shortcuts:

J – move focus to previous blade

K – move focus to next blade

F – move focus to first blade

L – move focus to last blade

Azure Portal keyboard shortcuts: blade focus

This is one of the first steps to make portal usable only with keyboard. Currently we are working on focus management (to have focus placed/restored on expected/useful items). We are planning to add more shortcuts, and keyboard shortcuts legend (available by pressing ‘?’).

What do you think? Are you using keyboard shortcuts on other websites?


WordPress on Azure: Exceeded ClearDB size = lock on INSERT/UPDATE (not able to log in to the admin panel)

My WordPress blog is hosted on Windows Azure, and I am using the only MySQL provider that is available on Azure: ClearDB.

Yesterday I couldn’t log in to the admin panel. I had no idea what was going on, because blog was working. I was googling for cause/solution, checking Azure logs, monitoring on Azure Portal, and accidentally I noticed that I exceeded ClearDB quota (20 MB). I did not receive any notifications from ClearDB though. What is important: if you exceed this limit, they block INSERT and UPDATE operations. My guess is that WordPress is probably trying to INSERT/UPDATE something in database when you log in. That’s why I couldn’t log in.

I did not want to upgrade from free instance to $9.99/month (the cheapest upgrade option). Fortunately I was able to connect with database using MySQL Workbench, and optimize my database.

I removed post revisions:

DELETE FROM wp_posts WHERE post_type = "revision";

And transients:

DELETE FROM wp_options WHERE option_name LIKE ('%\_transient\_%')

This allowed me to save a lot of space. From 20.28 MB, the database size went to 10.42 MB (transients occupied almost 8MB!):

 

ClearDB quota

After I did that, I was able to log in. However, INSERT/UPDATE lock is not revoked immediately. I had to wait something between 10 minutes and 2 hours. I went to the swimming pool in meantime, thus I am not sure how much exactly it take.

Useful SQL command to check you database size:

SELECT SUM(round(((data_length + index_length) / 1024 / 1024), 2)) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = '$DB_NAME'
ORDER BY (data_length + index_length) DESC;

You can also check each table size:

SELECT table_name AS "Tables",
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = '$DB_NAME'
ORDER BY (data_length + index_length) DESC;

For the future, I pinned the database size tile to my Azure Portal dashboard. Now, I will be able to see it every time I am visiting the portal. I also limited the number of post/pages revisions to 2, by editing wp-config.php file, and inserting this line:

define('WP_POST_REVISIONS', 2);

This should be enough to not exceed the quota for some time, but I will need some permanent solution. I am thinking about hosting my own MySQL database on LinuxVM, on Azure (cost: $13+).

During the troubleshooting I found very good blog post by John Papa: Tips for WordPress on Azure. I recommend you to check this out if you have a WordPress blog on Azure. This article will help you to optimize your WordPress database as well.

EDIT: The plugin Optimize Database after Deleting Revisions allow to clean up database even more efficient. I managed to slim my DB down by another 50%, to 4.11., which gives almost 80% size decrease from the original 20+ MB.

ClearDB quota with plugin

What is even more cool about this plugin, you can create a schedule to run it automatically (Settings -> Optimize DB options):

Optimize Database after Deleting Revisions - Options


Running the greatest VM on Azure

Recently Microsoft Azure introduced the New D-Series Virtual Machine Sizes. The “greatest” available VM has 16 cores, and 112 GB RAM. In my imagination it looks like that:

super PC

I thought it would be cool to create one, and play with it for a while. Not for a month, because that would cost almost $1000 (~700-800 EURO):

Azure VMs pricing

However, what is cool about Azure – you can scale VM down when you are not using it. Even to the cheapest option – A0 Basic (~10 EURO / month). And using D14 for an hour cost only ~1 Euro.

When I was wondering which OS install on the VM I found that Azure already offers Windows 10 preview VM:

Azure Windows 10 VM

 

This is how it looks after installation:

Huge VM

Working on this VM was even better (faster) than on my PC at work (Xeon with 6 cores and 32GB RAM). To stress the VM I opened over 100 instances of Visual Studio:

100 Visual Studios on Azure VM

After opening 90 instances the VM slowed down. I opened 103 Visual Studios in total, and VM didn’t crash.

This feeling of having the most powerful machine I have ever work on is amazing. Even though it is virtual. The most amazing thing is the fact that it cost me only 1 Euro to play with it for an hour. I can get it in a few minutes, and get rid of it within seconds.

I am using it from time to time as my playground, and scale-up/down according to my needs.

Later in this year, the G-series of VMs will be available on Azure. The biggest in this series would be G5: 32 Cores + 448 GB RAM. That’s gonna be…awesome!

happy


Azure tutorials to get started

Azure new portal

Recenetly I was exploring Windows Microsoft Azure.

Here are the best resources I found, and strongly recommend to get familiar with this powerful cloud platform.

To play with Azure get FREE Trial ($200 to spend in 1 month) and enjoy!

If you are thinking about moving your blog to Azure, check my post Moving WordPress blog to Azure from Webio hosting.


Moving WordPress blog to Azure from Webio hosting

Microsoft Azure

I decided to move my blog from hosting on Webio.pl to Microsoft Azure (formerly Windows Azure before March, 25th 2014). Why? To get more familiar with the Cloud and especially Azure.

I did my migration following Dave Bost’s series Moving a WordPress Blog to Windows Azure:

However, not everything went smoothly and easy. Additionally, I adjusted some steps to my needs/settings/plugins/hosting(Webio).

Small adjustments

Instead of connecting through FTP to copy content (uploads/themes/plugins), I used UpdraftPlus plugin. Moreover, I am using it for weekly backups all the time. It is really nice, especially the cloud backup option, which allows me to put backup files into my Dropbox automatically.

To export my database I used phpMyAdmin provided by Webio. As Portable phpMyAdmin plugin is no longer available, I took advantage of Adminer plugin to import database on Azure. Another option is to install phpMyAdmin on Azure.

I am using iTheme2 template, which allows to export customized settings (iTheme2/import tab). After migration, you can easily import it going to the same place.

I had bunch of themes installed. I was testing/experimenting with them when I started my blog. It took me a while to find a way to remove installed theme. You need to go to Appearance/Themes, click on theme you want to remove and then click delete button in right, bottom corner. I deleted all themes, but my current one (iTheme2) and Twenty-* themes.

WordPress - Delete theme

Webio specific

Specific for any hosting provider is setting the custom domain. In order to do that on Webio, you need to go to Domains/Edit DNS entries (in polish: Domeny/Edytuj wpisy w strefie DNS tej domeny). In the image below, there are DNS entries for my domain. Only highlighted entries matters for redirecting domain to Azure:

Webio DNS settings

When you add domain entries in Azure you need to add www.* entry separately (in my case: jj09.net and www.jj09.net). More details can be found here.

Azure - manage custom domains

Remember to create/update web.config file, in order to make your custom domain and permalinks (if you use them) working correctly (as mentioned in part 5 of Dave Bost’s tutorial):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<system.webServer>
		<rewrite>
			<rules>
				<rule name="Main Rule" stopProcessing="true">
					<match url=".*"/>
					<conditions logicalGrouping="MatchAll">
						<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
						<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
					</conditions>
					<action type="Rewrite" url="index.php"/>
				</rule>
			</rules>
		</rewrite>
	</system.webServer>
</configuration>

Issues

When I was trying to set SMTP server to my gmail I received following email from Google, after try to send test email:

Google hijack warning

After following steps in provided link, the issue was fixed. There is one interesting thing: I set region for my website to WestUS. However, Google says: “Location: Spain”. Hmm…

Another issue I had was getting 404 error on .woff file (Crayon Syntax Highlighter plugin font file). I solved it, by modifying web.config file as described here.

I had also problem with Tweet, Like, Google +1 and Share plugin. It dosn’t display buttons on home page. I tried some tricks (deactivate, re-install) to solve it, but I didn’t succeed.

Pricing

For hosting on Webio.pl I was paying around $20/year (start plan). On Azure, I will need to pay at least $10/month for shared instance (required to have domain jj09.net), which is $120/year. 6x more expensive! Am I crazy? No. As I stated at the beginning, I want to play with Azure. When I decide I am done with that, I can always go back to Webio.pl or some other hosting.

After one week, my estimated bill is  2,07 €.