From 1676, he was the tower watchman and later the choir director at the Church of Saint Peter in Munich. In 1688, he became a musician at the court of prince Maximilian Emmanuel, Elector of Bavaria who offered him the opportunity to pursue his musical studies in Rome with the leading Italian composer Arcangelo Corelli. In 1694, Pez was in the service of Joseph Clemens, Archbishop-Elector of Cologne at his residence in Bonn, working to improve the prince"s chapel orchestra.
In 1695, he became Kapellmeister and advisor to the prince.
Returning to Munich in 1701, he remained for five years at the court"s chapel. In 1706, he became the senior Kapellmeister (Oberkapellmeister) of Eberhard, the Duke of Württemberg, a position he held until his death.
He died in Stuttgart.