When testing new big features I sometimes have the need to quickly switch between two different "versions" of a virtual machine in a scale set. But since our current (test env) setup uses bare bone Ubuntu images and configures everything using a custom script, it takes quite a long time to create a new instance. So, if possible, I would like to be able to tell the scale set (or application gateway) which specific instance it should use for all incoming traffic. That way I can have both instances alive at the same time, and quickly switch back end forth when testing things.
I'm not interested in setting up multiple scalesets or application gateways, since I want all other components in the environment to use the same configuration, pointing to the same application gateway, and I don't want to have to do any configuration changes in all these components in order to achieve this switch.
So, does the scaleset or the application gateway offer any opportunity like this?
Is it perhaps possible to achive using the health check? If I can make sure that only one of the two instances returns a 200 OK for the health checks, can I then make it direct all traffic to the other one without the scale set automatically tearing down the "unhealthy" instance? Maybe there is a setting to disable this "kill any unhealthy instance" feature? Or is it possible to configure it in such a way that it takes maybe 1 or two "unhealthy" health check responses for it to remove the instance from the load, but let say 1000 "unhealthy" health check responses before it actually kills the instance?