Essential bifunctional enzyme that catalyzes both the N-deacetylation and the N-sulfation of glucosamine (GlcNAc) of the glycosaminoglycan in heparan sulfate. Modifies the GlcNAc-GlcA disaccharide repeating sugar backbone to make N-sulfated heparosan, a prerequisite substrate for later modifications in heparin biosynthesis. Plays a role in diffusion of morphogen wingless (wg) via its role in heparan sulfate proteoglycans (HSPGs) biosynthesis, HSPGs being required for movement of wg morphogens. Required for wg signaling during both embryonic and imaginal disk development. Also required for FGF receptor signaling. 3'-phosphoadenylyl sulfate + alpha-D-glucosaminyl-[heparan sulfate](n) = adenosine 3',5'-bisphosphate + 2 H(+) + N-sulfo-alpha-D-glucosaminyl-[heparan sulfate](n) Glycan metabolism; heparan sulfate biosynthesis. Glycan metabolism; heparin biosynthesis. Monomer. Belongs to the sulfotransferase 1 family. NDST subfamily. It is uncertain whether Met-1 or Met-154 is the initiator.