I’ve been a fan of Azure for a while now, but some of my coworkers, @cromwellryan and @stevemgentile, have compared it with Heroku and found it to be lacking. Heroku hosts web applications that have cloud scale an can be quickly deployed with git. Microsoft has apparently heard these complaints and recently released Azure Web Sites.
So what is an Azure website and how does it compare with what we’ve had in the past with Web and Worker Roles? And how do you create a website with Azure websites?
This is the first of a 2-part series of posts:
- Setup of Wordpress on Azure websites
- Migrating a blog from Blogspot to Wordpress on Azure websitesLet’s get started.
How are Azure websites any different from what Microsoft already provided with Web and Worker roles?
Web / Worker Role:
- Difficult to package and deploy outside of Visual Studio
- Deployment takes several minutes
- You have full control of the VM that your website is running on. You can install anything you want - windows services, MSIs, command line tools, apache, ruby, etc.
- Full Control of IIS. You can even turn it off and uninstall it if you want.
- Can connect to VM with remote desktop to troubleshoot problems.
- Role Environment. (I haven’t found much value in these libraries, but maybe others have)
- Can setup custom domain name (such as www.mywebsite.com) with SSL certificate
Can have hundreds (or more) Web Roles running in a load balanced fashion for high scale.
No packaging needed, can be deployed with git, FTP, web deploy, or Visual Studio
- Deployment takes only seconds
- Restricted to environment similar to other shared hosting environments - you can’t touch anything outsite your website’s folder. You can’t install alternate web server software. Only .Net, Node.js, and PHP applications are supported (all run on IIS).
- No control of IIS outsite of your own website.
- No remote desktop available (related to previous point)
- No Role Environment - some people consider this a plus, because making use of the Role Environment makes it more difficult to host your application outside of Azure.
- Unless you set up a reserved instance for your website, you cannot setup a custom domain name, such as www.mywebsite.com (Yet. Apparently it’s in the works for shared websites). SSL certs are available and free, but they are only for names like mywebsite.azurewebsites.net.
Can have at most 3 reserved website servers running in a load balanced fashion. This is likely a limitation of the preview, but we don’t know what this will look like post-preview.
And some similarities:
High Availability with Load balancing
- Can scale up and down on demand
- Can use the other Azure services, such as Tables, Blobs, Queues, SQL Azure, Access Control, Service Bus, etc.
- Both Azure Websites and Azure Web Roles can make use of Worker Roles to assist with background processing of data, but Worker Roles must be deployed separately from Azure Websites.
How much will this cost?
For now, shared hosting of Azure websites is free, and you can create up to 10 Azure websites. An Azure website on a reserved VM is $0.08 per hour, or about $57.60 per month (this is the same cost as a small Azure VM without the websites functionality).
The 1 MySQL database you can have is free for now, but is limited to 20MB in size.
SQL Azure, if used, is an additional cost, starting at $5 per month for a 100MB database.
Outgoing bandwidth is $0.12 per GB for outbound data (inbound data is free). So if your website has 100GB of outbound data per month, you’ll pay $12 per month for bandwidth charges.
For more details on the cost for using Azure websites, see https://www.windowsazure.com/en-us/pricing/calculator/ and https://www.windowsazure.com/en-us/pricing/details/.
Assuming you want an Azure Website, there are two approaches to creating it - you can build one yourself in .Net, PHP, or Node.js. Alternately, you can use a pre-built site including Wordpress, Drupal, Dot Net Nuke, Joomla, Orchard, etc.
For your data needs, you can still use Azure storage such ast Tables, Blobs, and Queues. If you need relational data storage, Microsoft can provide either a SQL Server backend or a MySQL backend. Yes, you heard that right - Microsoft is now providing hosted MySQL database services (via ClearDB). More on MySQL in my next post.
1. You need to have a Windows Azure account. If you don’t have one, go to https://www.windowsazure.com and click on ‘Free Trial’ in the top right for a 90 day trial.
2. Connect to the new management portal at manage.windowsazure.com.
3. Click the ‘New’ button in the bottom-left
3. Click on ‘Web Site’. If you haven’t yet signed up for the preview, click on the ‘preview program’ link. (If you’ve already signed up, skip to step 7).
4. Click ‘Preview Features’ at the top of the screen
5. In the ‘Web Sites’ section, click the green ‘try it now’ button
6. Choose the subscription (i.e., billing entity) to enable for the preview and click the check mark in the bottom-right corner.
6. You will then notice that under the green button it tells you that you are queued for the upgrade. You can click on ‘Status’ to find out how long you will have to wait. Once the upgrade is finished, navigate back to manage.windowsazure.com and click the ‘New’ button in the bottom-left again.
7. Choose ‘WEB SITE’ - ‘FROM GALLERY’
5. Choose ‘Blogs’, then ‘Wordpress’, then click the right-arrow in the bottom-right
6. Choose a name for your blog. For this example, I chose BestBlogEver, which will be available at BestBlogEver.azurewebsites.net (you can set up a normal DNS name later if you want, such as www.bestblogever.com). Then decide to use an existing or new MySQL database, and choose the region for the app to reside in. Then click the right-arrow in the bottom-right.
7. Choose a name for your database (I left the default), and the region for the database. I would highly recommend using the same region you just chose in the previous screen so that your web server and database server are in the same data center. Check the checkbox to agree to the terms and click the check mark in the bottom right corner.
8. You will then see your web site being deployed, and when it is ready the status will update to ‘Running.’ Click the link for your blog on the right to navigate to your blog.
- This will bring you to the Wordpress configuration screen where you can configure your blog. Fill out the form, click Install, then login, and you will then have your own custom installation WordPress on a Windows Azure Website with your own dedicated MySQL database.
Coming soon, I’ll discuss how I migrated my blog from Blogspot to Wordpress on Azure websites. This will include showing how to:
- Configure Wordpress
- Import posts and comments from Blogspot
- Choosing and setting up a theme
- Setting up 301 redirects
- DNS setup so you have your own domain name