Thursday's UEFA draw pitted the Euro 2004 finalist against a team that pushed France all in the way for Group D's automatic qualification spot in a rematch of the countries' 2010 World Cup playoff, which Portugal edged 2-0 on aggregate.
In the other matchups, Ireland was drawn to play away first against Estonia, which has never reached the finals of a major tournament. Euros debutant Montenegro will host the second leg against the Czech Republic, while Turkey, a Euro 2008 semifinalist, faces Croatia first in Istanbul.
First-leg matches will be played Nov. 11 or 12. Return games are scheduled Nov. 15.
Portugal's technical director Carlos Godinho said Bosnia was difficult to beat last time, when both matches resulted in tight 1-0 wins.
''It's not the opponent we would have preferred, but we have to take them on,'' Godinho told sports paper Record. ''Playing the first leg away gives us an advantage.''
Bosnia advanced to the Euro 2012 playoffs despite almost being kicked out of the tournament while suspended by FIFA and UEFA for two months last season over political issues.
Ireland returns to a major playoff two years after a controversial World Cup defeat by France, and drew the lowest-ranked unseeded opponent.
Estonia is 37th in UEFA's 53-nation European standings and advanced to the playoffs despite losing 2-0 against the Faroe Islands in qualifying.
''We should not underestimate our opposition, or any team, including Estonia,'' Ireland coach Giovanni Trapattoni said. ''To have made it through to the playoff, they must have quality and mental fortitude.''
The two countries have played only twice, when Ireland won 2-0 home and away in qualifiers for the 2002 World Cup, which was the last finals tournament Ireland reached.
Montenegro is playing in its first European Championship after being recognized as world football's newest nation in 2007.
''I think we can qualify. We play the second game at home and I believe in my team,'' coach Branko Brnovic said, adding that he was happy to avoid Portugal.
Czech coach Michal Bilek said Montenegro would not be an easy opponent.
''If we managed to win at home without conceding a goal, that would be an advantage for us,'' Bilek said.
Turkey was unseeded in the draw despite a memorable run at Euro 2008, and is coached by Dutch great Guus Hiddink who led Russia to the 2008 semifinals.
The finals tournament draw is made Dec. 2 in Kiev.
France, the 2000 winner, will be fourth-seeded unless the playoffs produce a series of upset victories.