The Future

a wide plaza between curved buildings with oval openings
The inner plaza at the Champalimaud Foundation.

Trivial Static Websites On Azure Blob Storage

At the risk of never getting around to picking up Kotlin, I’ve been revisiting other topics this weekend, namely updating last week’s Terraform example and figuring out the new features for static hosting on Azure, which I need to set up a little app I’m doing.

As it turns out, a preview of static websites on Azure storage was actually announced in this Build 2018 video. It was a fairly low-key affair, which I only noticed earlier in the week.

But since it’s public, you can get started using it right away–all you need to do is log in to the Azure Portal through aka.ms/staticwebsites, and you should have access to it.

Provisioning

The service is still only available in US West Central, so you should create a storage account in that region. Once you do that, you get a new Static website (preview) option in the portal settings blade:

portal settings
All the essentials

Publishing

To publish your site, all you need to do is upload your files to the newly created $web container. The canonical way to do so with a GUI is usually through Azure Storage Explorer, but I’m using Mountain Duck because it provides a virtual volume on the Mac, which is much nicer (if a trifle less efficient):

Finder window with storage account mounted locally and JavaScript files
It just works

I also tried to use the blobfuse FUSE adapter for Azure Storage (which would be a great way to automate site builds on Linux), but there is a niggling issue that I hope will be sorted out soon.

Pro Tips

To add a Cloudflare-managed CNAME to the storage account, you should first set the record to DNS only in the Cloudflare dashboard until it’s validated. Otherwise it obviously won’t resolve properly back to Azure.

Once you’ve bound the new domain name to the storage account, it then works exactly like you’d expect. I’ve had zero issues with CORS, content types and related stuff up until now, but I’ve barely gotten started with the app (it’s a simple single-page app that renders selected Azure metrics, something that I’ll write about at a later date).

This opens up a lot of possibilities for this site (I’ve been meaning to get it off a VM for a while), but in between fiddling with REST APIs and the need to fix a maven build, I’ll get back to exploring that some other weekend…

Terraforming Azure

As promised, this week I’m going to dive into Azure provisioning using Terraform, which is something I’ve been spending some time on, but which many folk in the Azure universe seem to be unaware of. Well, now there’s a copiously detailed example of how to bring them together, and I’m going to walk you through it.

Read More...

Keeping Tabs On Azure Usage Using Jupyter

I haven’t written much of anything about Azure over the past year or so, other than assorted notes on infrastructure provisioning (to which I will get back, now that Terraform has an updated provider), nor about machine learning and data science—the former because it’s not a very sexy topic, and the latter because most machine learning in real-life boils down to a lot of data cleaning work that is hardly reflected in all the pretty one-off examples you’ll see in most blog posts.

Read More...

The Maze

a glass walkway connecting two buildings over the road
Where I spent most of my time last month.

Static Considerations

Every now and then I ponder whether or not to move this site to purely static hosting (i.e., off an S3 bucket or an Azure storage account), both because it annoys me somewhat to maintain the VM and because the less code I have running to keep it up the better (and this even after having automated most away all chores and pared the code down to the absolute minimum).

Read More...

The Obligatory GPDR Notice

I have had to deal with GDPR in a professional capacity in a number of customers over the past few months, and, as usual, won’t write anything about that here.

Read More...

Maintaining Sanity

I’ve been traipsing round the countryside (near and far) on entirely too many customer visits, which, coupled with the return of my sinus troubles and a massive allergy, has done little towards either mood or creativity–hence the radio silence over the past couple of weeks.

Read More...

A Leisurely Lunch

a granite plaza in front of an old church
Near the Braga Cathedral, shown here in its gothic majesty.