If you want full control over your own blog with minimal investment of time and basically $0, Azure Static Web Apps are a good option. Below I’ve listed the steps I went through to create the blog you’re reading…right now! I’ve done my best to call out any gotchas that the Hugo and Azure documentation fail to mention.

Accounts You Need

There are a couple of accounts you’ll need to make sure you have first. One is an Azure account, the other is a GitHub account. Both are free.

Installing Hugo

The first step is to install Hugo on your local machine. I’m going to focus on the Windows install since that’s what I did. The Hugo installation guide is thorough but also quite long. I was a little confused about why there is a Quick Install section and then a separate installation guide for each supported OS. I used the installation section specific to Windows. This involves three steps:

  1. Download the latest zipped Hugo executable.
  2. Extract the ZIP file into a folder (the guide recommends C:\Hugo\bin).
  3. Add the Hugo bin directory to your Path environment variable.

That’s it! Now time to move on to site creation and Azure portal set up

Create A Hugo App

Microsoft has a tutorial for publishing a Hugo app to their Static Web App service so we’ll switch over to that for the remainder of the work.

Since you have already installed Hugo, you can skip straight to step 3 under “Create a Hugo App”. This involves using the Hugo CLI to create a new app. Since you added the Hugo bin directory to your path, you can call the Hugo CLI from any directory. You do not have to create your sites in the Hugo folder and it’s not a good idea to do so.

If you have other git repos on your machine, you may want to create your new site in the same location. Regardless, follow the instructions under Create a Hugo App up to step 7.

Instead of following the Microsoft instructions for installing your own theme, I would recommend going to the themes section of the Hugo site, selecting the theme you want, and following the instructions for that theme. I am using a theme called PaperMod, here are the installation instructions.

Return to the Microsoft tutorial after you complete theme setup. It will ask you to add your GitHub repository as the remote to your local repo. You will have to use a personal access token to do that, entering your password is no longer allowed. Here are the instructions to create a GitHub personal access token.

Deploy Your Static Site

At this point you can continue following the Microsoft tutorial to get your site deployed, except for one more small gotcha. Nowhere in the Microsoft tutorial mentions running the hugo command after creating the app and setting up a theme. You must run this command locally before deploying, or there will be nothing to deploy. Here is a short explanation of the hugo command.

After ensuring that you have run hugo once locally and committed the results, your site should deploy exactly as described in the Microsoft tutorial.