The draw sees Liverpool boss Jurgen Klopp return to his native Germany and striker Roberto Firmino take on his former club.
Scottish champions Celtic meet Kazakhstan side Astana, who they beat in the third qualifying round last season.
A fourth-place finish last season carried Hoffenheim into Europe for the first-time and they face a baptism of fire against the five-time continental champions from the Premier League.
Other pairings of note include Serie A side Napoli facing Ligue 1 team Nice, who disposed of Ajax in the third qualifying round, and Spanish five-time Europa League winners Sevilla taking on Istanbul Basaksehir of Turkey.
The first legs will be played August 16-17 (AEST) with the returns a week later on August 23-24 (AEST).
The draw for the group stage, which will include holders Real Madrid among Europe's elite, is August 24.
Ukraine's capital Kiev will host the final on Sunday, May 26, 2018 (AEST).
CHAMPIONS LEAGUE PLAY-OFF DRAW
Qarabag v Copenhagen
Apoel v Slavia Prague
Olympiacos v Rijeka
Celtic v Astana
Hapoel Be'er Sheva v Maribor
Istanbul Basaksehir v Sevilla
Young Boys v CSKA Moscow
Napoli v Nice
Hoffenheim v Liverpool
Sporting Lisbon v Steaua Bucharest