On January 5, 2018, Rosario signed a minor league contract with the Arizona Diamondbacks that includes a non-roster invitation to spring training.[4] In 51 games split between the Double–A Jackson Generals and Triple–A Reno Aces, he hit a cumulative .253/.288/.313 with two home runs and 19 RBI. Rosario elected free agency following the season on November 2.[5]
On January 9, 2019, Rosario re-signed with the Diamondbacks on a minor league contract. In 42 games for Triple–A Reno, he batted .250/.325/.307 with one home run and 11 RBI. Rosario elected free agency following the season on November 4.[6]
On January 10, 2020, Rosario again re-signed with the Diamondbacks on a minor league contract. On May 22, Rosario was released by the Diamondbacks organization, however, he re–signed with the club on July 27. Rosario did not play in a game for the team due to the cancellation of the minor league season because of the COVID-19 pandemic.[7] He elected free agency following the season on November 2.[8]