The common synthesis method is the "Wislicenus process," which proceeds in two steps from ammonia.
Curtius and Thiele developed another production process where a nitrite ester is converted to sodium azide using hydrazine.