Afterwords | Nagorno-Karabakh and Iran
Iran's declaratory position on the Nagorno-Karabakh conflict is different from its policy position.

Both the President and the Foreign Minister of Iran have declared Iran's neutrality in the NK conflict and have offered to help de-escalate. At the same time, the Supreme Leader's representatives in the four Turkish speaking provinces of Iran voiced their support for Azerbaijan's military operations against Nagorno-Karabakh.
In reality, Iran backs Armenia for several reasons but, the most important one is Azerbaijan's close economic, military, and intelligence ties to Israel, Iran’s mortal enemy and its biggest security & intelligence challenge.
"Israel’s main goal is to preserve Azerbaijan as an ally against Iran, a platform for reconnaissance of that country, and as a market for Israeli military hardware.”
(From a 2009 US diplomatic cable)
Iran has downed several Israeli-made drones flying reconnaissance missions close along its borders from bases in Azerbaijan and, it is well-known that Mossad has several signals intelligence stations along the long Azerbaijan-Iran border.
Azerbaijan is Israel's second-largest arms customer and gets 40% of its oil supplies from Azerbaijan. Israel is Azerbaijan's largest arms supplier and intelligence & surveillance equipment provider and also helps in suppressing the political opposition to the Aliyev dictatorship.
https://www.jpost.com/international/israel-and-nagorno-karabakh-according-to-liberman-644223
Security experts in the region do not believe that Iran would let Nagorno-Karabakh fall to Azerbaijani forces despite all the help it receives from the Erdogan regime and Israel. Iran supports Azerbaijan in rhetoric, but in practice, it quietly backs Armenia and assists in its military efforts to preserve the status quo.