Density functional calculations for hydrazoic acid HN3 and methyl azide CH3N3 and for the respective singly ionized structures HN3+ and CH3N3+ are reported. An analysis of the electrostatic solvent effects, based on the self-consistent reaction field approach, on the molecular properties and conformational equilibrium of CH3N3 is also reported. The results are sensitive to the basis set quality and show some dependence on the different representations for the exchange-correlation functions. For HN3 very good agreement with experiment is observed for several properties, such as the geometry, dipole moment, vibrational frequencies and for the adiabatic first ionization energy. For CH3N3 the energy difference between eclipsed (ec) and staggered (st) conformers (delta(ec-st)) is 2.5 kJ mol(-1), in good agreement with the experimental value (2.9 kJ mol(-1)), However, for CH3N3+, delta(ec-st) is -3.2 kJ mol(-1), reflecting a significant modification of the methyl group rotational potential after ionization. Solvent effects on the molecular properties of CH3N3 are important when it is solvated in a polar medium. The most significant modifications concern the dipole moment and the frequencies related to the CH3 symmetric stretch and torsion vibrational modes.