Pirlo, 41, was a legendary player for the club -- as well as AC Milan and Italy -- over his storied career, winning numerous league titles, the Champions League and a World Cup in 2006. He was appointed manager of Juventus' Under-23 side just last month but has now signed a two-year contract to coach the first team.
"Today's choice is based on the belief that Pirlo has what it takes to lead from his debut on the bench an expert and talented squad to pursue new successes," Juve said in a statement.
"Today begins a new chapter of his career in the world of football, as it was said almost a week ago: from Maestro to Mister," it added.
Juventus may be hoping Pirlo can replicate the achievements of Zinedine Zidane, another former world class player who has enjoyed success at Real Madrid despite having no previous coaching experience.
Ex-Juve player Zidane has won two La Liga and three Champions League titles in two stints with the Spanish side since he was first handed the reins.
"The decision for Pirlo was very natural, in the Juventus style, because he is someone who played for us, has always been in contact with everyone here and it felt natural," said the club's chief football officer Fabio Paratici.
"We also believe he is pre-destined for greatness. He was as a player and we are confident he can do the same as a coach."
Under Sarri, Juventus suffered a round-of-16 exit to the French club despite a 2-1 win on Friday night, losing on the away goals rule as the tie ended 2-2 on aggregate.
A Juventus statement said of his sacking: "Juventus Football Club announces that Maurizio Sarri has been relieved of his post as coach of the First Team.
"The club would like to thank the coach for having written a new page in Juventus' history with the victory of the ninth-consecutive championship, the culmination of a personal journey that led him to climb all the divisions of Italian football."
Despite winning a ninth successive Serie A title last month, Sarri's team did not manage to convince the critics during his first season in charge. Their failure to even match last season's quarterfinals performance in the Champions League was the final straw for the 61-year-old.
Sarri leaves Juventus with a record of 34 wins in 51 competitive matches, eight draws and nine defeats. Their tally of 83 points in Serie A this season was the lowest of their nine-season run of titles. Juventus also lost the Italian Supercup to Lazio and the Coppa Italia final to Napoli.
"If I wasn't devastated by not qualifying, I'd be happy with the performance," Sarri said after Juventus' defeat to Lyon.
"I actually expected less from us, I think we played a great game. We fell behind to a penalty kick that could have made us lose our heads and we had three chances when we were 2-1 ahead."
A report in France had claimed Ronaldo wanted to move to Paris Saint-Germain. Sources have told ESPN, though, the Ligue 1 side are prioritising the contract renewals of key players Kylian Mbappe and Neymar.
"I am entirely convinced he will stay," Agnelli said. "I think the report was down to an interview from several months ago, which just happened to be published just before we played against a French team. It's an old media trick. No, I can assure you that Ronaldo remains a pillar of Juventus."
Information from Reuters was used in this report.