The 100 most expensive transfers ever
The Italian side have agreed to pay a loan fee of €6 million, and the club has an obligation to buy Costa for a fee of €40m.
The Brazil international struggled for game time throughout the 2016-17 season, making just 23 Bundesliga appearances, though he did score four goals and provided six assists.
Juventus are confident that they can bring the best out of him, and have confirmed his arrival on Italian soil.
Once his loan is complete Costa will sign a five-year permanent contract, worth €6m per year.
Juve have embarked on an aggressive summer of recruitment, signing Juan Cuadrado on a permanent deal from Chelsea, Rodrigo Bentancur from Boca Juniors and Medhi Benatia from Bayern.
Bayern appear to have already signed the Brazilian's replacement, confirming the acquisition of James Rodriguez on an initial loan deal on Tuesday.
Costa, who was also linked with Tottenham, has made a total of 77 appearances for Bayern, scoring 14 goals, and also made over 200 appearances for Shakhtar Donetsk in Ukraine.