Atletico Madrid and Chelsea were matched in the other semifinal as UEFA threatened the English club with sanctions if it tried to enforce a pay-to-play clause written in the contract for loaning goalkeeper Thibaut Courtois to its Spanish opponent since 2011.
On the field, the city of Madrid will host the first two matches on April 22 and 23, as Atletico first hosts Chelsea at the Vicente Calderon Stadium one night before Madrid welcomes defending champion Bayern to the Santiago Bernabeu Stadium.
"We are the teams who are playing the most attractive football right now," former Bayern and Real Madrid great Paul Breitner said.
Nine-time champion Madrid and five-time winner Bayern have also been runner-up a further eight times, yet never met in the final.
Bayern is looking to become the first team in 24 years to repeat as Europe's top club after cruising to the German league title.
"We acknowledge that Bayern Munich, since the beginning of the season, the performance has been amazing," Real Madrid director Emilio Butragueno said. "But we are Real Madrid and when we compete, we compete to win."
Atletico will face the 2012 champions, who the Spanish club routed 4-1 in the UEFA Super Cup two years ago.
A potential dispute over Courtois appeared to be resolved by UEFA one hour before Friday's draw. Chelsea has a contract clause entitling payment for letting the Belgium international play for Atletico against the club which signed him two years ago as a long-term successor to veteran Petr Cech.
"It follows that any provision in a private contract between clubs which might function in such a way as to influence who a club fields in a match is null, void and unenforceable so far as UEFA is concerned," the European football authority said in a statement.
Atletico director Clemente Villaverde noted that UEFA rules were different to those in the English and Spanish leagues, which allow clauses barring loaned players from opposing their original club.
"UEFA has the competence in this matter," said Villaverde, stressing that his club had good relations with Chelsea.
Madrid-Bayern is a repeat of the semifinals two years ago decided by a penalty shootout at the Santiago Bernabeu Stadium after each team won 2-1 at home. Then, Cristiano Ronaldo was among three Madrid players who failed to score from the spot.
The semifinal lineup includes three coaches who each have two Champions League titles with other clubs: Bayern's Pep Guardiola won with Barcelona in 2009 and '11; Madrid's Carlo Ancelotti with Milan in 2003 and '07; Chelsea's Jose Mourinho with FC Porto in 2004 and Inter Milan in '10.
Mourinho could become the first to coach three different clubs to the European title. Guardiola and Ancelotti aim to become the fifth coach to guide two different clubs to the title.
The odd man out, Atletico coach Diego Simeone, won a Europa League title with the club in 2012.
Ancelotti also played for AC Milan when it was the last back-to-back champion, winning the European Cup in 1989 and '90.
The Italian coach is seeking to take Real Madrid to its first final in 12 years. Under Mourinho, it lost in the semifinals for the past three seasons.
"I'm confident we can do what is needed to win," Ancelotti said. "Guardiola is one of the best coaches in the world and the series against Bayern will be difficult for both teams."
The return matches will be played on April 29 in Munich and the following night in London. The final is scheduled for May 24 at the Stadium of Light in Lisbon.Suggest a correction