Who are the goodies and baddies or Whose side are we on?
It's a bit all over the place to be honest! The terrain being fought over is internationally recognised as being "owned" by Azerbaijan but the people who live there are 85%+ Armenian and in the early 90's, as the USSR fell, they declared their "territory" to be independent of Azerbaijan and fought a small conflict which saw Azerbaijan leave the area and the pro-Armenia population believe they'd won their independence.
However in reality they hadn't and the claim of independence was never internationally recognised and "peace talks" were still on-going to resolve the issue.
The two big issues break down to "land vs people", where the international community are being asked which is more important, the claim to the land by the owners or the wishes of the people who live on the land? As we saw in the Falklands, the UK falls inline with the right of population to self determine which country they want to be attached to, but in this case the land is still attached to another country which makes it similar to the Crimea which is "owned" by the Ukraine but populated by Russians, and therefore this situation is extremely similar to Russia's Crimea grab where Russia said "the majority of the people here are ethnically Russian and want independence, so we're annexing the land away from the Ukraine and giving it to the people".
When it comes to which nations are allies to each country, Azerbaijan is allied with Turkey, has a mostly Muslim population and is fairly authoritarian (inline with current Turkey) whilst Armenia is kind of allied with Russia through a defence pact (unlikely to be activated unless Turkey gets more involved), is mostly Christian and more liberal in outlook and giving more Freedoms to it's population all the time but its still got a way to go to ditch it's Soviet inspired outlook TBH.
For myself, I see this recent flare-up to be yet more Turkish world-stage "interference" vs Russian interests, following the Turkish invasion of Northern Syria (against Russian interests as a by-product) and involvement in Libya (again against Russian interests) yet this constant Erdogan vs Putin infighting is at odds with the many Russian deals Turkey received in the 2010's alongside a period of extremely cordial relations between Putin and Erdogan, so I wonder if Erdogan has found some kind of Russian involvement in the attempted 2016 Coup and that is why he is specifically sending his military against areas of Russian influence over the past few years, to extract punishment on Russia but without leading to direct Russia vs Turkey warfare?