From 1757 he was conductor in Grosswardein (now Oradea), and in 1763 he was appointed court musician and concertmaster at the court chapel at Salzburg. In 1777 Haydn became organist at the Holy Trinity Church, and after the retirement of his close friend Wolfgang A. Mozart in 1781, he also served as cathedral organist. For the court he wrote instrumental music and stage plays, while also developing extensive musical activity at the cathedral and in the monasteries of St. Peter and Michaelbeuern. At the chapel house he taught violin and piano; among his many pupils, Carl Maria von Weber became the best known. Visits to Vienna in 1798 and 1801 brought him muchdeserved recognition, and he received commissions for masses and other sacred music from the Austrian and the Spanish courts. He refused the position of vice-conductor offered him by Prince Esterházy,Esterhazy, preferring to remain in Salzburg despite the smaller salary.
Haydn's greatest works were his sacred compositions, of which he wrote more than 350 in Latin and German; of the latter, the Mass Hier liegt vor deiner MajestätMajestat is still sung. His secular music is more routine, except some beautiful chamber music, several symphonies, and an operetta, The Wedding on the Alp. With Mozart, Michael Haydn had a very considerable influence on the development of sacred music.