Can I use something like deployments slots with Azure Storage Static Website?
Asked Answered
V

2

6

I tried the Static website feature for Blob Storage in Azure and it is great!! Just copied my SPA static files (js, html, css, ...) and everything worked. Now to my question: how can I update the files and make sure that they are consistent?

With App Services I could use deployment slots and swap them when they are ready. If I just copy a new version the clients could get an inconsistent version (some files from the older one, some others from the new one).

This would be a huge problem for my .js files. Can I use something like a transaction that will make my files visible just when all of them were copied?

Voleta answered 6/11, 2018 at 9:50 Comment(0)
B
3

Consider creating another Storage Account that represents a staging environment and use Azure Traffic Manager to implement a swap.

This will also allow you to perform a blue-green deployment where you can send only a few user (lets say 1%) to your new deployment...

Bearcat answered 6/11, 2018 at 9:53 Comment(5)
Yeah, I'd say TM is one of the options for this. Have to keep in mind the time-to-live of the DNS responses from TM though. So someone who accessed the page would access that version for as long as the TTL is.Orangy
Perhaps instead of TM, consider Cloudflare. Then you don't have to deal with the latency of a DNS update when you swap your blue-green deployments.Search
Thank you Martin!! This means adding yet another service to my deployment. I liked the idea of using Azure Storage for my SPA assets and Azure Functions for my "business logic" (at least for some small things). I will accept your answer if nobody has another one.Voleta
@Voleta How did you manage to get the traffic manager to work with static websites? Whenever I route traffic through the traffic manager to the static website I get an "The request URI is invalid." error by the storage account.Grandson
Hi @JoCa, we didn't implement it in production as today. We continue to use "classical" App Services that host the static files as well and use the normal deployment slots. Maybe we will reconsider it later or wait for the functionality to be added to Azure.Voleta
U
0

For those that can't find how to setup the Azure Storage Account with Traffic Manager like I could not, here:

Setup the traffic manage endpoint as a External endpoint, then add the storage account's FQDN found on the static website page. Then set the custom domain of the storage account to the traffic manager's DNS name.

Upend answered 24/3, 2021 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.