Azure finally has the ability to host static websites straight from storage! This is great news since I do a lot of client-side development that have minimal back-ends
It’s not as quick and easy as some of the services that specialize in hosting static sites, especially if you like to use the CLI, but if you’ve invested in the Azure ecosystem and you like static sites it’s definitely worth looking into.
The feature is in preview and may break at some point before general release. Consider yourself warned. I myself will be using this in my most crucial production sites, because I’m about that life.
Here’s how you do it
This will create a container a container in blob storage, called $web. It also gives you the endpoint for your site
With that done, you are done. You can upload your static files from the portal, storage explorer or the CLI, however if you are interested in continuous integration, read on
Crack open Azure DevOps, and create a new project.
Go to Azure pipeline and click on Pipelines>Releases>New Pipeline. Start with an Empty Job.
Skip adding a task to Stage 1 first, and add an artifact. I have a really simple web page so I don’t need to build anything before release, so I connect my github as a service to this project and release straight from commits to get the artifacts
Click on the thunderbolt and enable continuous deployment trigger
Now click on Task>Stage 1, add a new task and search for Azure File Copy
Be sure to change the version to 2.*. Once you authorize your subscription, it’ll auto-fill in almost all of the fields, but you will need to type in $web for the container
Click save. Boom, all done
So now you have CI/CD with static website on Azure – go ahead, make a commit