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 determining the extent and pattern of sulfation of heparan sulfate. Compared to other NDST enzymes, its presence is absolutely required. Participates in biosynthesis of heparan sulfate that can ultimately serve as L-selectin ligands, thereby playing a role in inflammatory response.