Azerbaijan and Iran have engaged in a war of words that has escalated into military drills along their border.