The Dane has already tested for Hendrick Motorsports in the past thanks to his ties with General Motors in the American Le Mans Series, and drove a Cup car for the last time in April at Carolina Motorsports Park to help with the squad's road-course development programme.
Phoenix Racing, a team that runs Hendrick engines, will provide Magnussen with the chance to race for the first time at NASCAR's top level, joining Mattias Ekstrom as both make their stock car debuts next weekend.
"It's no secret that NASCAR has been a goal of mine, and I'm very appreciative of the opportunity Phoenix Racing is providing," Magnussen said. "Through my relationship with GM, I've had the chance test for Hendrick Motorsports, so I'm comfortable in the Sprint Cup cars and understand what to expect.
"I'm quite familiar with the racetrack and confident in my ability to compete at a high level. It will be an exciting weekend, and I look forward to the entire experience."
The team has started a number of races this year with Aric Almirola and Mike Bliss and expects to get the most out of Magnussen's experience on road courses - which it hopes could bring its best result of the season.
Last year the outfit claimed its maiden Sprint Cup victory at Talladega with Brad Keselowski.
"We're extremely excited to have a road racer of this calibre available to drive for us at Sonoma," said team owner James Finch. "Jan has tested Sprint Cup cars in the past, and his resume speaks for itself. He will give us an opportunity to not only qualify well, but run up front and compete."
Magnussen is competing in the Le Mans 24 Hours this weekend, driving a Chevrolet Corvette alongside Johnny O'Connell and Antonio Garcia, having qualified second in the GT2 class.
Magnussen tests for HendrickBenzema’s Real happy