The Pianist star will join Kathy Bates, Owen Wilson, Marion Cotillard, Rachel McAdams and France's First Lady Carla Bruni in Midnight in Paris.
He tells WENN, "When I've been asked about directors I'd like to work with it's always been Woody Allen, so I'm very happy about that. It's a cameo but it'll be a lot of fun.
"I get to reconnect with Owen Wilson, who's a good friend. And shooting in Paris isn't bad, so I'm very grateful."
The all-star film also features Michael Sheen, Kurt Fuller, Tom Hiddleston and Alison Pill, and follows a family travelling to Paris for business. The party includes a young engaged couple that has their lives transformed throughout the journey.