Liverpool will face Hoffenheim in their Champions League play-off as they look to book their spot in the group stage.
The Reds missed out on a chance to face former striker and current Nice man Mario Balotelli. The Ligue 1 side will play Napoli.
Brendan Rodgers' Celtic, meanwhile, face a trip to Kazakhstan where they will play Astana.
Former Premier League duo Emmanuel Adebayor and Gael Clichy face a tough task as their İstanbul Başakşehir side play Sevilla.
The Champions League hopefuls will play the first leg of their ties on August 15/16. The return legs will take place the following week on August 22/23.
The draw in full:
Qarabag vs Copenhagen
APOEL vs Slavia Praha
Olympiacos vs Rijeka
Celtic vs Astana
Hapoel Beer-Sheva vs Maribor
İstanbul Başakşehir vs Sevilla
Young Boys vs CSKA Moscow
Napoli vs Nice
Hoffenheim vs Liverpool
Sporting CP vs FC Steaua Bucharest