Arthur Melo notched his first goal for the Turin club in the first half with a deflected strike and USMNT midfielder Weston McKennie headed home the second after 71 minutes.
Bologna goalkeeper Lukasz Skorupski made some stunning saves to keep his side in the match and the visitors also had good chances in an entertaining encounter at the Allianz Stadium.
It was a much-needed victory for Pirlo’s side following the disappointment of their 2-0 defeat to Inter Milan last weekend as it cut the gap behind league leaders AC Milan to seven points and the champions also have a game in hand.
Juventus are fourth with 36 points from 18 games, one point behind AS Roma in third. Bologna are 13th with 20 points.