We have a product that we build through Azure DevOps. This product is made up of about 20 different services that each get built in their own pipelines. At the end of each pipeline we push the output (a docker image) to an Azure Container Registry using the Build ID as the ID for that image.
We then have a DevOps Release that deploys to our Test (and then Prod) environments. It looks for the latest build for each pipeline and uses that ID to determine the relevant image to deploy for each service.
I'm now trying to build a build a new DevOps Release that will allow our QA team to deploy a given Branch to a new QA environment. I want the user to be able to select a Branch and for DevOps to determine the last build for each pipeline for that specific branch - or if that branch has never been built for a given pipeline then to fallback to the last Master branch build for that pipeline.
I can't see how to add a Branch variable that will then re-calculate the Artifacts when triggering a manual build. And, while I can get it to find the latest build for a particular branch but no way of getting it to fall back to Master if no build has been done for that Branch.
Is it possible to do this? If not, is there another approach to achieving the same outcome?