Keuchel, 34, had signed a minor league contract with the Diamondbacks earlier this month. He had been released by the Chicago White Sox after going 2-5 with a 7.88 ERA through eight starts this season.
"He threw the ball really well in his last outing," Arizona manager Torey Lovullo said. "We've been having a lot of discussions. We had some internal options. We feel like he deserves this opportunity, and he's been working really hard to make this happen."
Keuchel won the American League Cy Young Award with the Houston Astros in 2015 and is a two-time All-Star and five-time Gold Glove winner. He has been reunited in Arizona with pitching coach Brent Strom, who worked with Keuchel in Houston from 2014 to 2018.
By adding Keuchel to the 40-man roster, the Diamondbacks are responsible for a $396,154 salary, a prorated share of the $700,000 major league minimum. The White Sox remain responsible for the rest of his $18 million salary this year and a $1.5 million buyout of a 2023 option.
Keuchel, who is 101-87 with a 3.86 ERA in 262 career games with 251 starts, last pitched in the majors for the White Sox on May 26, when he lasted just two innings, allowing seven hits and six runs in a 16-7 loss to the Boston Red Sox.
He was 0-2 with a 4.50 ERA in two starts while pitching in the Arizona Complex League prior to his call-up.
The Diamondbacks have started 14 pitchers in the No. 5 spot of the rotation, and they have combined for a 7.93 ERA.
"We have a fifth spot vacancy," Lovullo said, "and we need somebody to step up."
The Associated Press contributed to this report.