Why did Russia choose to support Armenia in the Nagorno-Karabakh war?

by Inkshooter

Azerbaijan had (and still has) a much larger population and a far stronger economy than Armenia. Why did Russia support Armenia in this conflict, gaining Armenia as a loyal ally but distancing themselves from Azerbaijan? Why does Russia continue to support the Armenia and the Nagorno-Karabakh republic militarily and economically?

haf-haf

any evidence on Russia supporting Armenia in this conflict? Russia sells huge amount of arms to Azerbaijan, even though it has a military base in Gyumri but Russia used to have military bases in Azerbaijan and Georgia as well until recently.