Let's build a blog! - Part #3

Posted by : on

Category : Guide


This is part 3 of ‘Lets build a blog!’.

Things are really starting to gain momentum now! I have a bona-fide Jekyll-powered website hosted on an Azure Static Web App. All that’s needed is a custom theme and get it wired up into Azure DNS.

For a collection of themes, I didn’t need to go any further than Jamstack Themes. They have an excellent range to choose from and an easy filter option based on static site generators (SSG), content management system (CMS) or even the underlying CSS implementation of themes.

Jamstack filter list

Note: I was going to include a screenshot of the theme I chose, but if you’re reading this then you’ve already seen what theme I went with.

With my hosting solution sorted, and a look-and-feel established, it’s time to get the last part done: Add a Custom Domain.

I already have a domain registered, so that’s nice, but to make it usable I need to delegate my domain to Azure DNS. The steps Microsoft provide are adequate, if not minimal, and I had quite a few additional steps to complete on account of having an existing email service to migrate.

Setting up a custom domain with Azure DNS is where the documentation started to diverge with what I was seeing in the Azure portal. According to the above-linked document, I need to first create a DNS record under Azure DNS, and then configure the static web app to use that DNS entry.

This seems to be a good example of where the service offering has advanced ahead of the documentation, because the process was quite a bit simpler than that. Instead of manually creating DNS records, proving ownership via TXT records and then wiring up the static web app by hand, the entire process now appears to be automated. I love that!

Configuring Azure DNS for a static web app is actually much simpler than the documentation suggests:

  1. From the Static Web App portal page, open the Custom Domain blade.
  2. Click the Add button, selecting Custom Domain on Azure DNS

validating-waiting-dns.png

  1. In the next section, enter the domain name in its entirety (i.e. blog.advocacy.dev)
  2. From the drop-down selection, choose the DNS Zone, in this example advocacy.dev

validating-waiting-dns.png

That’s it! From here, the portal will spend a few minutes churning through what was once a manual process, and will look like this in the process: validating-waiting-dns.png

Upon completion, there was a new CNAME record in my Azure DNS zone with my web site listening on the other end of it.

Having got this far, I was already thinking about the next-step of procuring an SSL certificate for my hosted site. So I was pleasantly surprised to find out that part of the service offering of custom domains for static web apps is that the SSL certificate is automatically generated. Brilliant!

validating-waiting-dns.png

This is the attention to detail that really adds value to a Platform-as-a-Service (PaaS) like this. Administration & engineering tasks, like separate deployment environments for feature branches & pull-requests, domain ownership setup and SSL certificate purchase & renewal are just built-in, leaving me plenty of time to focus on delivering content to the platform, instead of configuring the platform. That’s a real value-added proposition for adopting a service such as this.

Speaking of value. The total cost of hosting a static web app on Azure?

Free!

That’s right! Free! All of this has been achieved using the Free Tier of Azure Static Web Apps!

Now, you may remember back in post #1 where I made mention of Three Easy Steps to set up a blog

Yeah, about that.

It was more than three steps. And some steps were not that easy (albeit ‘easy’ is a subjective notion).

And while my hosting costs may be free, the website in its entirety remains free only if my time has no value. I certainly invested a lot of time & effort in setting this up, and fully acknowledge that this approach to a low-cost blog-hosting solution will not be for everyone. But hey, at least I got some content for it along the way!

That right there is really what it’s all about for me; the journey being more important than the destination. The destination is what gives me a reason to embark, but it is the journey that holds value, as that’s where new knowledge and experiences are acquired.

So with all that out of the way, its time to mark this story as done!

Welcome to advocacy.dev!


About Aaron White

I'm a Developer Advocate. I aim to make software development more accessible for everyone.

Star
Categories
Useful Links