  The astronomical detection of formamide (NH$_2$CHO) toward various
star-forming regions and in cometary material implies that the simplest amide
might have an early origin in dark molecular clouds at low temperatures.
Laboratory studies have proven the efficient NH$_2$CHO formation in
interstellar CO:NH$_3$ ice analogs upon energetic processing. However, it is
still under debate, whether the proposed radical-radical recombination
reactions forming complex organic molecules remain valid in an abundant H$_2$O
environment. The aim of this work was to investigate the formation of NH$_2$CHO
in H$_2$O- and CO-rich ices under conditions prevailing in molecular clouds.
Therefore, different ice mixtures composed of H$_2$O:CO:NH$_3$ (10:5:1),
CO:NH$_3$ (4:1), and CO:NH$_3$ (0.6:1) were exposed to vacuum ultraviolet
photons in an ultra-high vacuum chamber at 10 K. Fourier-transform infrared
spectroscopy was utilized to monitor in situ the initial and newly formed
species as a function of photon fluence. The infrared spectral identifications
are complementarily secured by a temperature-programmed desorption experiment
combined with a quadrupole mass spectrometer. The energetic processing of
CO:NH$_3$ ice mixtures mainly leads to the NH$_2$CHO formation, along with its
chemical derivatives such as isocyanic acid (HNCO) and cyanate ion (OCN$^-$).
The formation kinetics of NH$_2$CHO shows an explicit dependency on ice ratios
and compositions; the highest yield is found in H$_2$O-rich ice. The
astronomical relevance of the resulting reaction network is discussed.
