You'll always get asked at the passport control in Azerbaijan if you've been to Armenia. There should be no problem if you have an Armenian stamp in your passport (just expect a long waiting time with annoying questions) but you will be denied entry if you have a Nagorno-Karabakh stamp.