Gannon received a five-year contract.
The move comes two days after the Eagles lost Super Bowl LVII to the Kansas City Chiefs 38-35 and Gannon's defense gave up 24 second-half points in letting a 10-point halftime advantage slip away.
The other two finalists for the job were Cincinnati Bengals defensive coordinator Lou Anarumo and New York Giants offensive coordinator Mike Kafka.
Gannon, 40, had been the Eagles' defensive coordinator for the past two seasons and immediately made an impact. He turned Philadelphia into a top-10 defense in his first year, and this season, the Eagles ranked No. 2 in the league while boasting two Pro Bowlers.
Philadelphia went from allowing 26.1 points per game (20th in the league) in 2020, the year before Gannon was hired, to 22.7 in 2021 (18th) and 20.2 in 2022 (eighth). The Eagles' 78 sacks in 2022 were the third most in a season in NFL history, including playoffs.
Gannon replaces Kliff Kingsbury, who was fired in January after going 28-37-1 with one playoff appearance in four seasons, and becomes the Cardinals' fourth head coach in seven years.
He inherits a roster set for an overhaul, with 31 players expected to become unrestricted free agents.
When Cardinals owner Michael Bidwill began his coaching search in January, he said he would "cast the net far and wide." He lived up to his words, as the Cardinals are the last team to hire a coach this cycle after the Indianapolis Colts hired Eagles offensive coordinator Shane Steichen on Tuesday.
The last time a Super Bowl participant lost both its coordinators in the same offseason was after the 2016 season, when the Atlanta Falcons lost offensive coordinator Kyle Shanahan, who became the San Francisco 49ers' coach and fired defensive coordinator Richard Smith, who later took a job as the Chargers' linebackers coach. Those changes came after the Falcons blew a 28-3 lead in a 34-28 overtime defeat to the New England Patriots in Super Bowl LI.
The last Super Bowl team to lose both coordinators to head-coaching jobs was the 1994 49ers, when Mike Shanahan was hired by the Denver Broncos and Ray Rhodes was hired by the Eagles, according to NFL Research.
Bidwill hired Gannon after being connected to eight other candidates, including Sean Payton, Brian Flores and Dan Quinn.
Arizona is coming off a 4-13 season. Since reaching the 2015 NFC Championship Game, the Cardinals have made just one playoff appearance, a wild-card loss to the Los Angeles Rams after the 2021 season.