Azerbaijan finished the match with 10 men after Maksim Medvedev was shown a red card in the 73rd minute.
Portugal had to settle for a place in next month's World Cup play-offs despite beating 10-man Luxembourg 3-0 in Coimbra.
Rock bottom Luxembourg did themselves no favours when forward Aurelien Joachim was sent off for a nasty tackle on Andre Almeida in the 27th minute.
Two minutes later Porto forward Silvestre Varela, deputising for the suspended Cristiano Ronaldo on the wing, put the home team in front when he dribbled round the goalkeeper following a defence-splitting pass by midfielder Joao Moutinho.
Manchester United winger Nani, who captained the side in Ronaldo's absence, blasted the second goal after 36 minutes after a flowing move that featured a delightful back-heel from Moutinho.
Moutinho was also involved in the third goal by Helder Postiga in the 78th minute.
Steven Davis' second-half strike ensured Northern Ireland's disappointing World Cup campaign ended on something of a positive with a battling 1-1 draw in Israel.
Captain Davis lashed home a powerful effort with 18 minutes left, responding to Eden Ben Basat's headed opener just before the break.
A share of the spoils represented a fair verdict - and a surprising one given Northern Ireland's form and depleted numbers - allowing Michael O'Neill's men to banish at least some of the scars accrued during defeats to Luxembourg and Azerbaijan.