Azerbaijan's president says his forces have taken a key town in the breakaway region of Nagorno-Karabakh.