On 12 July 2017, Costa joined Juventus on loan until the end of the 2017–18 season, for €6 million. Juventus has an option to make the move permanent on 1 July 2018, for an additional €40 million fee (plus €1M in bonuses). On 13 August, he made his club debut, coming on as a substitute in a 3–2 defeat to Lazio in the 2017 Supercoppa Italiana. On 14 October, he scored his first goal for the club in a 2–1 home defeat to Lazio. In his debut season he scored four goals in Serie A in 31 appearances, and two goals in five appearances in the Coppa Italia (one of which came in Juventus's 4–0 victory over Milan in the 2018 Coppa Italia Final, at the Stadio Olimpico in Rome, on 9 May), recording six goals in 47 appearances across all competitions, as Juventus won a domestic double; he also led the league in dribbles (106) and recorded the second-most assists (14) in Serie A.