Iran last month protested against what it said was the presence of its sworn enemy Israel in Azerbaijan and vowed to take any necessary action.
It staged military exercises near its border with Azerbaijan, sparking criticism from officials in Baku, which has denied Iranian claims.
Azerbaijan said Wednesday its Foreign Minister Jeyhun Bayramov had spoken by phone with Iranian counterpart Hossein Amir-Abdollahian and the pair had agreed to resolve differences through dialogue.
"The sides noted that recent rhetoric has harmed bilateral relations and that any differences should be settled through dialogue," Azerbaijan's foreign ministry said in a statement.
Israel is a major arms supplier to Azerbaijan, which late last year won a six-week war with neighbour Armenia for control over the disputed Nagorno-Karabakh region.
Azerbaijan and Iran have long been at loggerheads over Tehran's backing of Armenia in the decades-long Karabakh conflict.
Last year's brief war ended with a Russian-brokered ceasefire that saw Yerevan cede swathes of contested territories, including a section of Azerbaijan's 700-kilometre (430-mile) border with Iran which for decades had been under Armenian control.
Azerbaijan's decision to impose customs duty on Iranian truck drivers transiting to Armenia through that territory also fuelled tensions.
The statement Wednesday from Azerbaijan's foreign ministry said the two sides had agreed it was "necessary to establish direct dialogue between government agencies of both countries on transit issues."
Tehran has long been wary of separatist sentiments among ethnic Azerbaijanis, who make up around 10 million of Iran's 83 million people.