Skip to main content

Azure Static Site

Problem statement

I would like to host a static site on Azure.

Solution

I have hosted a site on Azure Web App before. This time I wanted to try Azure Static web. There’s lots of material out there I chose to follow Miscrosoft documentation with reference to John's blog post and other posts highlighted in the reference section.

I started of with creating a docusaurus site on my local machine. It's very easy & quick to create. Process documented here.

I then commited my code on Azure Devops Repo.

According to Miscrosoft documentation, things suppose to be eazy but that's not the case.

Issues

2 issues that needs workaround

No Organisation Issue

Following Miscrosoft documentation, you should be able to select your subscription on the organisation dropdown but the functinality does not work. Googling the issue looks like its common, best way is to create custom build configuration as specified here. I got the build idea from hendrik

Google Domain issue

According to Microsoft, google domains do not support domain records that affect how you configure your apex domain. Therefore we need to delegate our domain to azure. In summary we have to

  • Create Azure DNS
  • In google domain, setup custom name servers
  • In Azure static app, add a custom domain
  • Back to Azure DNS you need to add TXT and A or ALIAS record All details well documented on Manuel's blog

Reference