The azides can be obtained by nucleophilic substitution using sodium azide. This ion is a strong nucleophile while a weak base and therefore it easily leads to SN2 reactions, unless the reacting carbon is too crowded.
If the azide attack is performed on an epoxide, the ring opening proceeds regioselectively following the cuasi-SN2 mechanism at the less hindered position.