Tuesday 29 May 2012

DDDSW Roundup and Resources

On Saturday 26th I presented Defensive Programming 101 at DDD Southwest. As you may or may not be aware, the Developer Developer Developer or DDD brand of events are free one day events for the community by the community. Speakers submit their sessions and the attendees decide which ones they would like to see. The sessions with the most votes make it into the conference.

This was my fourth DDD event as I have been lucky enough to present at DDD Scotland twice and DDD North. This time at DDDSW, I got the pre-lunch slot, so to be fair to the attendees, I usually speed up a bit so that they can get out for lunch a wee bit earlier and skip the queues.

DDD Southwest was very well organised, with plenty of food, good facilities and good technical gear on site. This makes your job when you are presenting a lot easier. They even managed to sort out some amazing weather for the event and even so there was still in excess of 300 people at the event. My thanks again to the organisers, for minding us and making sure we had a great conference experience.

Thanks again to those who made it to my session and as promised, here is a list of the resources slide (which as always gets skipped at the end because there is way too many links on it)

Resources Slide 1

Resources Slide 2

As I said in my talk, many thanks to Troy Hunt for his kind permission on using some of the information on the ELMAH configuration errors which is detailed here

Monday 21 May 2012

Using the Azure CDN

A while back I toyed with the idea of moving all my blog assets (images, downloads, etc) over to a CDN just as a proof of concept and to show how it could be done and as a very handy way to get inspiration for a blog post. This evening I finally got around to it. And this post details how to do it.

So first a few basic things about the whole concept of a CDN.

What is a CDN?

A Content Delivery Network (CDN) according to Wikipedia is “a large distributed system of servers deployed in multiple data centres in the Internet. The goal of a CDN is to serve content to end users with high availability and high performance”. Its a large system of caching servers located around the world, speeding up the delivery of your content by reducing the distance between your users and your content and providing higher redundancy.

Why use a CDN?

One of the main reasons to use a CDN is more servers hosting your files, means higher availability meaning that if a node is down, the request will rollover to the nearest node after that.

Also it reduces the latency for your files when you have people accessing your site outside your hosting catchment for example, if your server is hosted in Dublin and a significant amount of your traffic comes from APAC. By using a CDN, your static resources that you have on your blog/site are cached in different locations around the world. When a user requests a file that is hosted on your CDN, the file is served where possible from the closest node in the CDN.

About the Azure CDN

The Windows Azure Content Delivery Network (CDN) caches Windows Azure blobs and the static content output of compute instances at strategically placed locations to provide maximum bandwidth for delivering content to users. You can enable CDN delivery for your content providers using the Windows Azure Platform Management Portal. CDN is an add-on feature to your subscription and has a separate billing plan.

Azure CDN nodes are located worldwide and you can get a list of them here

Setting up on the Azure CDN

This is one of the easiest things to do with Azure. As in absurdly easy. You will need an Azure account and you can sign up for a 90 day free trial at the Windows Azure Portal. You will need a credit card when you sign up to verify but you will not be charged and if you go over your free limit, it will just stop however you can allow it to run and charge to credit card if you so wish.

Once you have your account, sign into the management portal.

Now create a new storage account. This is where you will serve your static resources from. You do not need a hosted account to serve the files.

Type in the name and select the region for the storage and then once done wait for the storage to provision

Once the storage is ready, click on the CDN folder on the left of the management panel. You will see your newly created storage account. Click on the New Endpoint from the top menu and select the defaults.

The CDN endpoint will provision and you will eventually get a URL like XXXXXXX.vo.msecnd.net which is fine but most people want to have their own domain or subdomain on the CDN and this is very easy to do.

Click on the CDN endpoint and select Custom Domain from the top menu. You can insert the address that you want the CDN to resolve to. For example the one for this blog is assets.certsandprogs.com.

A verification CNAME will be created which points to verify.azure.com and you will need to create this CNAME in your domain management of your provider.

Once you have done this, go have a cup of tea or coffee because you will need the new CNAME to propagate and this could take a bit of time depending on your provider. For example, with GoDaddy, it took about 5 minutes but on a previous test, it took two hours on a different provider.

You can click validate to check and once its working you will see Allowed in the custom domain line.

The final thing you need to do now, is create a CNAME that points to your Azure CDN endpoint address. Once all this is done you will be able to use your brand new shiny CDN.

Getting files into the CDN for non programmers.

There are plenty of tutorials on how to get your data into blob storage so you can use your search engine of choice to find these. However, for the non programmers among you (why are you reading this blog?), there are a couple of programmes you can use to get your data into blob storage and onto your newly provisioned CDN

Azure Storage Explorer on Codeplex allows you to see your blob storage in a logical view as well as creating containers and upload objects to your containers.

So that’s about it, a fairly painless way to migrate to the cloud without needing any code.

All the images that in this post are being served from the CDN and I will migrating all the scripts used in the blog over to the CDN over the coming weeks. If I manage to create a nice little migration tool, I will share it on this blog.

Thursday 3 May 2012

Windows 8 Developer Day

Today I presented on the new features in Visual Studio 11 as part of the Windows 8 Developer Day in Oslo

The resources slide is replicated here

If you managed to make it here then the QR code worked!