Connecting Domains to Azure Web Applications is much easier than you think

I love it when a job turns out to be much easier than I was expecting. I’m building a portal site for the Connected Little Boxes project. It is going rather well. I’ll be giving folks access to it soon so that they can create their own devices and control them from anywhere via the web. The site is hosted on an Azure web application that has been great fun to build. But I want the site to have its own domain, rather than https://clbportal.azurewebsites.net/ (although this works fine). This morning I thought I’d sort it out. I was a bit worried about fiddling with domain names and Azure settings and whatnot. But I had the whole thing working before my coffee break. I bought the domain clbportal.com from namecheap . It cost me around 12 pounds. Then I followed this really useful howto which took me through configuring the domain and setting it up on Azure. If you are making anything you want to make public you really should give it a custom domain. It makes it look a lot more professional and it makes it much easier to move from one provider to another.

The only thing that caught me out was the way that https seems to work on my new domain. You can browse to the site using http://clbportal.com but if you do this you end up being served pages which are not secure. If you go to https://clbportal.com you get the secure version. Normally the two work interchangeably, but one of the things that my site does is connect to your device over the serial port on your computer. This only works if you are browsing from localhost or a secure server. There is talk of an Azure setting that you can tweak to make sure your site is always served as the secure version but I can’t find it anywhere. So instead I’ve changed the internal references so that when you navigate around the site you get sent to the secure versions.