Azides are energy-rich compounds with diverse representation in a broad range of scientific disciplines, including material science, synthetic chemistry, pharmaceutical science and chemical biology. Despite ubiquitous usage of the azido group, the underlying biosynthetic pathways for its formation remain largely unknown. Here we report the characterization of an enzymatic route for de novo azide construction. We demonstrate that Tri17, a promiscuous ATP- and nitrite-dependent enzyme, catalyses organic azide synthesis through sequential N-nitrosation and dehydration of aryl hydrazines. Through biochemical, structural and computational analyses, we further propose a plausible molecular mechanism for azide synthesis that sets the stage for future biocatalytic applications and biosynthetic pathway engineering.