I’ve officially and finally moved away from a traditional web host, and over to Azure for my main sites:
- www.sedersoftware.com (for BizSpark – and that is still in-progress)
- www.robertseder.com & www.robseder.com
- blog.robertseder.com & blog.robseder.com (formerly robseder.wordpress.com)
Where do I start? There are a LOT of cool things I’ve learned – but there are a lot of pieces to this! Let me first summarize what I did:
- (optionally) Obtain a BizSpark membership (free MSDN and Azure, if you have a website stating you are an ISV) start here: https://www.microsoft.com/bizspark/SignUp/default.aspx
- (optionally) Obtain domain names. I use www.networksolutions.com and have robertseder.com and robseder.com
- Activate Azure membership (as part of BizSpark)
- Create websites on Azure (one for www and one for blog)
- Export old blog to a file (wordpress.com/wp-admin/export.php?type=export).
- Import blog file to new site (wordpress.com/wp-admin/admin.php?import=wordpress).
- Set up an Team Foundation Service account (http://tfs.visualstudio.com) – this is TFS’ answer to GitHub and BitBucket. You can host small, private source code repositories in TFS, and take advantage of all of the features of TFS.
- Wire up the TFS project to deploy to Azure.
- Change DNS pointers to point to Azure
What is Azure?
Azure is “the cloud” for websites, databases, services, and the like. Azure is similar to a traditional “web hosting” provider, except it’s much, much more than that – and that idea, taken to the next level.
For example, if you were starting a business, you could host your website, database and even all of your internal business critical applications in Azure, securely. It’s Microsoft’s far-more-robust competition for Amazon’s cloud services (a.k.a. EC2).
Why Host in Azure?
There are two significant reasons. Azure is one of the top-two cloud-hosting vendors out there, so professionally it doesn’t hurt to get familiar. Secondly, they have a really powerful, really useful web console for managing your hardware and software resources.
Getting BizSpark, to get MSDN and Azure for free:
I’ve had my eye on Azure for quite some time but have hesitated in switching over because of cost. Although “cloud hosting” scales remarkably well, the barrier-to-entry is a tad high. When I say a “tad” high, I mean that I currently pay ~$5/month for web hosting and the Azure equivalent would be around ~$15/month. Not breaking the bank, but that is 3x times as much!
It came up today that since I have BizSpark and MSDN, I also get a basic Azure account too. See:
Windows Azure for BizSpark members
So, I activated this subscription. The screens were all very intuitive and simple. Once set up, I started by by creating a “Web Site” for my www and my blog site. You click the “+” in the bottom left of the screen, on the portal (https://manage.windowsazure.com/)
I think I need to “sign up” to activate the “web site” feature because it is in beta, maybe? Anyhow, so this creates a free website on a shared server. You are limited to [mydomainname].azurewebsites.net
If you want your own domain to be hosted there or if you need SSL, then you MUST upgrade to a “reserved instance”. With your BizSpark account, you can do that.
Click “Scale” menu at the top, then change to “Reserved” and choose 1 small instance – that is what you get with BizSpark.
If you don’t have BizSpark – then this is where Azure would start costing money. Now, for the WordPress part…
Porting Your WordPress site:
I logged into my old site (http://robseder.wordpress.com) and you can go to /wp-admin/export.php?type=export on your own site to start this. From there, you can export all posts, categories, comments, tags, etc to one XML file.
Now, in Azure, I created a new “web site” from a “gallery”
Again, this was very intuitive – just follow the prompts. This will create a new mySQL database for it and prompt you to create the admin login.
Once your site is up and running, navigate to it in a browser (log in to the new WordPress site) and navigate to /wp-admin/admin.php?import=wordpress
There are two catches here. First, you will see that the maximum size of the import file is 2MB. In my case, my import file was 3.5MB. If you try to do it anyway, you will get an error message that says you can up the limit by modifying the php.ini file.
As it turns out, you don’t have access to the php.ini file in Azure. However, in the same message board I found that, I found the solution too:
The answer is:
basically, upload a .user.ini file to root folder of your web site which contains following line:
upload_max_filesize = 10M
Umm… How do I upload a file? For a regular, deployed site I could – but with WordPress, Azure manages that. Well, when you have the blog website selected in the Azure portal, choose “WebMatrix” in the bottom bar:
WebMatrix is a ClickOnce app that let’s you manage the file system. So, I created a .user.ini file (note the LEADING “.” is needed) – and then clicked “Publish”.
It somehow knew how to update the site. It only pushed what it needed too:
Earlier, I said there were two catches. The first is you need to upload that file. The second is that the import kept timing out. So, I would kick it off again. It turns out, the importer is smart enough to see a specific item was already added. So, after re-running the import probably 10 times, I eventually got everything imported.
OK, next I need to both update my DNS to point to Azure, and I need to configure Azure to know that traffic will be heading to it. I started with Azure. When you have a site selected in the Portal, choose Manage Domains in the bottom bar:
from here, it tells you exactly what to do:
So, I logged into Network Solutions and created CNAME entries:
and then also set the A records too:
Back in Azure, you can now put in those entries and it configures what it needs to inside of Azure. On your LOCAL machine, if you need to refresh your DNS cache so that you can pick up the new addresses, you can always do “ipconfig /flushdns” and “nbtstat –R”:
Using tfs.visualstudio.com to do CI and continuous-delivery:
In addition to having a WordPress site that hosts my blog, I also want a regular website to host “www”. Why not use Visual Studio + TFS + Azure all together? This is crazy-simple and very cool!
Navigate to http://tfs.visualstudio.com and create an account if you haven’t already. Create a new project. I called mine RobertSeder.PublicSite.
Now, in Azure, in the portal, choose the www site. Look at the navigation on the right:
Click “Set up TFS publishing”.
So, this uses OAuth and has you log in, you choose the project and voila! When you check in files into TFS, it will do a build and push out changes to this site!
Well, this is sort of a lot of work. However, I am now basically hosting my websites for free, and I’ve learned a ton about Azure and the TFS (http://tfs.visualstudio.com) – this all works together quite nicely.
I think I covered everything I did – if not or if you have questions, let me know!