Catalyzes the last step in biosynthesis of uridine diphosphate-N-acetylglucosamine (UDP-GlcNAc) by converting UTP and glucosamine 1-phosphate (GlcNAc-1-P) to the sugar nucleotide (PubMed:9603950, PubMed:9765219). Also converts UTP and galactosamine 1-phosphate (GalNAc-1-P) into uridine diphosphate-N-acetylgalactosamine (UDP-GalNAc) (PubMed:9765219). In addition to its role in metabolism, acts as a regulator of innate immunity in response to virus infection by mediating pyrophosphorylation of IRF3: catalyzes pyrophosphorylation of IRF3 phosphorylated at 'Ser-386' by TBK1, promoting IRF3 dimerization and activation, leading to type I interferon responses (PubMed:36603579). {ECO:0000269|PubMed:36603579, ECO:0000269|PubMed:9603950, ECO:0000269|PubMed:9765219}. [Isoform AGX1]: Isoform AGX1 has 2 to 3 times higher activity towards galactosamine 1-phosphate (GalNAc-1-P). . [Isoform AGX1]: Isoform AGX2 has 8 times more activity towards glucosamine 1-phosphate (GlcNAc-1-P). . This is the function of UAP1 (UDP-N-acetylglucosamine pyrophosphorylase 1, ENSG00000117143).