At the end of the Nagorno-Karabakh war, why was the region under Armenian control not formally annexed by Armenia (especially given Armenian forces retain control over the region until today)? I only have minimal understanding of the conflict but was under the impression that by the end of the war, the Armenian forces had gained an upper hand. If that is the case however, why was Armenia not in a position to dictate more favourable terms for itself?
International norms. Since roughly WWII, it's been very rare for international organizations like the UN or NATO to recognize territorial changes adjudicated through conquest. Look at North Cyprus, or Western Sahara--they've been under the control of Turkey and Morocco, respectively, for decades but few countries formally acknowledge it. When you see a UN health statistic map, for example, you'll see that Western Sahara has "no data" even though Moroccan data includes data from Western Sahara and it is made to appear like the data from Cyprus covers the whole island. Look at this map for example (you can't really see Cyprus, but trust me, it's undivided in that map).
Second, the norms of how states change borders have become fairly firm. Other than colonial possession, you see states can split up (as in the Soviet Union or Yugoslavia, most famously, but also East Timor from Indonesia, Singapore from Malaysia, Eritrea from Ethiopia, and South Sudan from Sudan), and you see them combine (as in Vietnam, Tanzania, Germany, Yemen, Sikkim going in India), but I can not think of a single case since 1946 where a significant part of one state broke off and was allowed to join another, other than a few random post-colonial cities like Ifni or Pondicherry or Hong Kong. There have been many attempts that have failed, like Iraq's attempts to annex parts of Iran and all of Kuwait, but I honestly cannot think of an example that has succeeded. You see small border adjustments here and there, but they're mainly technocratic things that affect few people--nothing like before WWII when you'd see Alsace go to France, and then the Sudetenland go to Germany, and then Germany and the USSR split Poland, etc. Kosovo is 90% ethnic Albanian, but when it broke off from Serbia, it was explicitly not allowed to join Albania. Furthermore, when 10% of Kosovo that is ethnic Serb lives next to Serbia, but they're not allowed to split off from Kosovo and join Serbia. The international community is also generally very reluctant to recognize split-off claims at all without the state they're splitting off from approving, which is why we have a laundry list of things like Transnistria, Abkhazia, Puntland, Somaliland, Tamil Eelam, North Cyprus, Palestine, Daesh, and even Kosovo itself (Serbia officially only recognizes Kosovo as having a "special status" within Serbia--Kosovo was a weird precedent for NATO to set, but they haven't really followed up on it).