The Foals will meet the Swiss side over two legs, with a place in the lucrative Champions League group stages at stake. Andre Schubert's men will head to Bern on August 16 before the return leg takes place a week later.
Borussia Mönchengladbach have been drawn against BSC Young Boys of Switzerland in the Champions League playoff round, with a spot in the group stages up for grabs.
Having finished second to FC Basel in the Swiss Super league, Young Boys had to deal with an additional qualifying round before reaching the play-offs. Despite this they were able to get the better of Shakhtar Donetsk courtesy of a penalty shoot-out following a 2-2 draw on aggregate.
The Germans will be hopeful of progressing when they meet Young Boys, even though the two clubs have never recorded a competitive fixture with each other. However, when they travel to the Stade de Suisse Andre Schubert's side will have to contend with the issue of playing on an artificial surface.
"We have been given a tough draw," said Gladbach sporting director Max Eberl. "Presumably we are pushed into the favorite role against this opponent, but this is a match against the runner-up in Switzerland and for me, it's a duel at eye level."
Elsewhere, Pep Guardiola's Manchester City will be facing off with Romanian side Steaua Bucharest, while Porto meet with Roma and Villarreal take on Monaco.
Champions League playoff round draw:
Young Boys vs. Borussia Mönchengladbach
Porto vs. Roma
Villarreal vs. Monaco
Ajax vs. Rostov
Steaua Bucharest vs. Manchester City
Celtic vs. Hapoel Beer Sheva
Copenhagen vs. APOEL
Dundalk vs. Legia Warsaw
Dinamo Zagreb vs. RB Salzburg
Ludogorets vs. Viktoria Plzen