I think IRAN's behavior in their relationship to Armenia is linked to their alliance with Russia in the past decade.
Azerbaijanis seem to be turning their back to the south Caucasian ethnic identity they built under Soviet influence and heading towards a more pan-Turkic one.
It'd be interesting to see exactly how many south Azebaiianis would want independence though, in the past they seem to have been quite loyal to Iran while now there are people who became very enthusiastic about Azerbaijan's victory over Armenia. Are there any polls measuring how many of them would like an union with Azerbaijan given a democratic choice?