Armenia and Turkey are certainly not allies. Since Armenia is backed by Russia, this also meant that the latter country figured in the consequences of the agreement. And Russia, remember, was going to provide missiles to Cyprus, missiles the Turks threatened to go to war over. Looking at the map, it is easier to see that Greece sees this alignment as helpful in strengthening their options in dealing with Turkish aggressive claims on Greek territory. What is less immediately obvious is why Orthodox Christian Greece should find common cause with Islamic Iran against a nominally Islamic but officially secular Turkey.
Some history helps.
It is often said in the west that Turkey is an important ally because it is a link to the Moslem world. However, Turkey has a defense pact with Israel. That puts a strain on its relations with both Arab countries and with Iran. Iran also expresses concern about the repeated suppression of Moslem culture by those in power in Turkey. Turkey also has close connections with Albania.