Dan Schnau

Time is of the Essence: Crafting an Image Management Solution in One Hour

Today I put together an image management solution for Dan Schnau dot com in about an hour.

Before today, my image management workflow was as follows:

  1. Add the image to the wwwroot/img directory in source code.
  2. Make a commit and re-deploy the DanSchnauDotCom app.
  3. Reference the image in markdown.

Committing and re-deploying with every image became intolerable. It took too long. It wouldn't scale beyond one post per month. These images belong in long-term storage, not in source code.

These images have no place in source code, yet here they are.

The solution: Azure Storage and Azure Front Door

First, I created an Azure Storage Account. This took five minutes to create and configure. In the Azure portal, you can drag and drop images. That means I can take screenshots and load them into Azure immediately.

My new Azure Storage account.

This would have been good enough of a solution, but Microsoft recommends against anonymous public read access to blob data. It's recommended to use Azure Front Door, Microsoft's recommended CDN product, for both security and performance benefits.

I created a Front Door config and tied it to my storage account. Now images are loaded through a cached CDN, and I can use the generated URLs while typing markdown posts, like the one you've read here, and no commits are needed.

My Azure Front Door configuration

I put together an image management solution for my own needs in about an hour. I can help you with yours as well.