Iran can give Azerbaijan the support it needs to return Muslim territory in Nagorno-Karabakh, then separatist demands will decrease.Iran wants to keep Israel and Turkey out of Azerbaijan and best way to do that is to support Armenia.
Also, Azerbaijan/Turkey/Israel probably want to try taking back Iranian Azerbaijan to test Iranian defenses, but they will be fools to do it because they will get crushed by Iran if they try it.
However if Iran keeps playing these games against Turkey and Azerbaijan (and also Afghanistan and Pakistan,) it will backfire.
All of Iran's neighbors have problems with Iranian meddling, Iran is creating an alliance against itself in its geopolitical space. US installed pro-Iran governments of Afghanistan and Iraq are losing relevance to anti-Iranian groups.