Past crisis provided a reality check for Ankara and Baku