0

As part of our release pipeline we deploy to Azure blob store (static websites). So every time the release pipeline runs, it overwrites the contents of the blob store with the new build artifact created and we see the latest changes.

For debugging and internal testing we have a requirement where each deployment instead of overwriting the existing contents of the blob store, creates a version.

So if a dev checks in their changes to master and a new artifact is generated, it gets deployed to https://abc.z22.web.core.windows.net/1. The next time a new change is checked in to master, it creates a new version at - https://abc.z22.web.core.windows.net/2.

There is versioning in blob store that was added recently but you have to manually go in to the blob store and mark a version as current.

Is there a way to achieve this ? Any other Azure offering that can help with this ?

Megatron
  • 11
  • 2

1 Answers1

0

OK. Looks like you want all the versions to be active and available on different urls. I dont think its possible with azure web apps as well. Potentially you can spinup a new container when there is new code push and run it on a different port. But, you will have to build the logic of limiting the number of containers as you cannot go infinitely. Rather unusual requirement. Or, you can use slots in web app to serve multiple versions at the same time but its limited based on the tier you opt for.

rohit
  • 666
  • 8
  • 24
  • Please correct me if I am wrong - when I get the latest version number from the blob store and then increment it, how does this help with versioning the actual static website url ? The actual url is hardcoded when we enable the static website option in a blob store. I want a way to version that url. – Megatron Sep 10 '20 at 18:27
  • 1
    Ok solved this. For future readers - Ended up creating a dynamic folder structure based on the buildId configured in Azure devops pipeline. Then instead of doing a static website for the azure blob storage, added an azure function which reads from whatever the path you pass in. So the blob store has folders like - $web(container name) - 1400 - 1401 - 1402 And the azure function can access it via abc.azurewebsites.net/1400/index.html You have to configure the azure function to read the blob depending on the route. – Megatron Sep 16 '20 at 09:09
  • @Megatron Does this also work with e.g. React Routing? The main difference between blob storage preview and azure static web apps is that it enables to have custom routing and paths, which is not avaible when previewing an app on blob storage. If this works with paths, can you elaborate a bit more on how you did it? – Νίκος Τιτομιχελάκης Feb 07 '22 at 10:49