He participated in the Gunboat War as artillery officer He eventually rose to Lieutenant Colonel in the Norwegian Army, a rank he acquired in 1843. As a politician Foss was elected to the Norwegian Parliament in 1827 from the constituency Bergen, in 1830 from Moss, and from Christiania in 1833, 1836, 1839, 1842 and 1845.
He was mayor of Christiania in 1838, 1840 and 1841.
Foss authored several publications, including Bergens Beskrivelse in 1824 (with Lyder Sagen), publications on politics as well as songs. Some of the songs were intended to celebrate the Norwegian Constitution Day, of which Foss was a proponent.
He also proposed a Norwegian civil ensign during the personal union with Sweden. Streets have been named after him in Bergen, Oslo and Kongsberg.