Ferrell and co-star Rachel McAdams play a pair of Icelandic musicians pursuing their ambitions of representing their country in the competition, which was held in Edinburgh in 1972.
Ferrell, who is best known for his starring role in Anchorman, co-wrote the script for the Netlix movie, Eurovision Song Contest: The Story of Fire Saga.
Scenes were shot in Edinburgh at Calton Hill, Arthur’s Seat, Victoria Street, the Grassmarket, the New Town, the Royal Mile and Newhaven Harbour.
Glasgow Airport and the Hydro, the city’s biggest indoor music venue, were among its locations to be deployed for the film, which will was also partly shot on location at the real-life contest in 2019, which was staged in Tel Avid, in Israel.
Ferrell and McAdams play Lars Erickssong and Sigrit Ericksdottir, who perform together as the double act Fire Saga, in the film.
It also features Pierce Brosnan, who was spotted during location filming in Edinburgh.
The trailer opens with Sigrit explaining that the duo, who perform as the band Fire Saga, have dreamed about competing in the Eurovision Song Contest since they were children.
At one point Lars says: “We have to prove to Iceland and my extremely handsome father that my life hasn't been a waste.”
Publicity material for the film, which will be launched on Netflix on 26 June, states: “When aspiring musicians Lars and Sigrit are given the opportunity of a lifetime to represent their country at the world’s biggest song competition, they finally have a chance to prove that any dream worth having is a dream worth fighting for.”
The Netflix production arrived in Edinburgh last autumn shortly after filming had wrapped on scenes for the ninth instalment of the Fast & Furious franchise.
Edinburgh is set for a starring role in another Netflix movie after former High School Musical star Vanessa Hudgens spent several weeks in the city shooting the Christmas movie The Princess Switch: Switched Again.
The three productions helped ensure it was a bumper year for location filming, worth £14.4 million to the economy in total - the second most valuable since records began.
Rosie Ellison, manager of the Film Edinburgh commission, said: “Edinburgh’s wealth of locations and facilitation expertise play an important part in our ability to attract films, and it was wonderful to work with a team who clearly enjoyed being here. We hope the film will bring a smile to millions of fans around the world and look forward to welcoming visitors inspired by the film once we are through the current crisis.”
When filming of the Eurovision movie in Edinburgh was confirmed last year, Cammy Day, depute leader of the city council, said: “It is a source of real pride that Edinburgh attracts these kinds of projects and it’s very exciting to welcome the latest project from Netflix to the city next week. We welcome filming for the economic benefit, employment opportunities and the on-screen promotion it brings.
“Productions are exciting for film fans and we ensure that filmmakers engage with all residents and businesses within the area in which they plan to film, to make sure that life can continue with as little disruption as possible.”