Pirazzi and Ruffoni both ride for the all-Italian Bardiani team and face being "immediately sacked", according to organizers, just hours after a glitzy pre-race presentation on the seafront at Alghero in Sardinia.
The Giro d'Italia, whose prize is the coveted pink jersey, starts in Alghero on Friday and ends in Milan on May 28th.
In accordance with UCI rules, both riders are now suspended facing further investigation. They tested positive during out-of-competition controls on April 25th and 26th respectively.
Pirazzi, 30, won the best climber's competition at the Giro in 2013 and won a stage to Vittorio Veneto in 2014.
Ruffoni, 26, is in his fourth year as a professional. According to UCI rules, Pirazzi and Ruffoni's positive tests could lead to the suspension of the entire Bardiani team for a period of 15-45 days.
Bardiani said they were "shocked" by the news, and confirmed they will sack the pair if a counter analysis confirms the initial results.
"We are absolutely shocked by this news," team managers Bruno and Roberto Reverberi said in a statement.
"The riders are now no longer part of our team for the Giro d'Italia and have been suspended from all activity, in accordance with the UCI rules.
"We will await the results of future tests, in accordance with the anti-doping rules, but we reaffirm our intention to safeguard the values that have allowed our (team) project to develop in recent years."