Margairaz was born in
Rances. After beginning professionally with
FC Lausanne-Sport and
Neuchâtel Xamax, he was part of the
2005–06 and
2006–07 Super League-winning teams of
Fussballclub Zürich. In May 2007, Margairaz signed a three-year contract with
Spanish side
CA Osasuna, where he struggled with first-team opportunities. In late February 2008, in a
friendly match with
SD Eibar, he suffered a serious knee injury (
anterior cruciate ligament, internal lateral ligament and external
meniscus). After a successful surgery in
Geneva, he missed
UEFA Euro 2008 as his recovery process was estimated to be of at least eight months; this happened a week after another serious knee-injured
central midfielder of the
Navarrese club,
Javad Nekounam, began training. On 14 January 2009, Margairaz moved back to FC Zürich on loan until the end of
the season. In June, after he helped the team to another league title and Osasuna received
€400.000, the move was made permanent. On 15 September 2009, Margairaz became Zürich's first scorer in the
UEFA Champions League, netting in a 2–5 home loss against
Real Madrid in
the group stage. In January 2012, he moved to
FC Sion on a three-and-a-half-year contract, leaving in June of the following year. ==International career==