Samardzija -- a candidate to start opening day at Pittsburgh on April 1 -- walked three, including two when he loaded the bases with none out in the second inning, was making his second spring start and became the first Cubs pitcher to get through three innings.
Cubs manager Dale Sveum has not named his Opening Day starter and said again Friday he plans to do that closer to the middle of the month. Right-handers Matt Garza, who has been slowed this spring by a lateral strain, and Edwin Jackson, who pitches Sunday, are the other candidates.
"Hopefully, I can just keep doing my work and see what happens," said Samardzija, who last season made a successful transition from bullpen to starting rotation. "Today the splitter was a little off, but I thought I got some good work in and they put some good at-bats out there. I got out of a couple jams, and that felt good, too."
Samardzija allowed a single and two walks to load the bases in the second, but a double play and strikeout limited the damage to one run allowed.
"To get out of there with one run, especially with a two-run lead, that's important," he said. "You don't want to be in those situations, but you're going to be in those situations during the year, and when it happens, like today, you just take a deep breath and understand, `Let's work on getting out of this situation so when it happens during the season, we have a little better idea how to do it.
"You definitely will go back to those things and see how you got out of them."
Arizona starter Trevor Cahill pitched two innings in his first start of the spring, allowing the first three batters he faced to reach in a two-run first before retiring the final six he faced.
"I was just trying to throw strikes and get a feel for the game again," Cahill said. "Just trying to get those cobwebs off and feel comfortable."
Former Cubs outfielder Tony Campana, who was traded to the Diamondbacks last month for two pitching prospects, came off the bench to deliver a two-run double to right in Arizona's four-run sixth inning and later added a triple.
"When you get rid of somebody like that, those things just seem to happen," Arizona manager Kirk Gibson said. "He's been working hard in the cage on putting the bat on the ball."
Second-year left-hander Patrick Corbin, who's trying to beat out Tyler Skaggs and Randall Delgado to win the fifth-starter job, earned the win for Arizona with the top performance of the day: three scoreless innings with four strikeouts and three hits allowed.
"He spots his ball well, and his slider was a really good pitch for him this game," Gibson said. "He keeps his composure and continues to make good pitches."
Chicago first baseman Anthony Rizzo, who leaves Monday to join Italy for the World Baseball Classic, gave the Cubs the early lead with a run-scoring double to left in the first and then added a single in the third.