Novel heterocyclic arylazo-disperse dyes containing pyrazolo[1,5-a]pyrimidine structures were prepared via conventional refluxing and microwave heating. Starting from cyanoacetic acid, 4-arylazo-2H-pyrazol-3-ylamine was obtained from a sequence of reactions. This pyrazole intermediate afforded the target arylazo-pyrazolo[1,5-a]pyrimidines and pyrazolo[1,5-a] pyrimidin-7-ones upon cyclization with 3-piperidinylacrylonitrile, ethyl acetoacetate, ethyl(arylhydrazono)acetoacetates, or (arylhydrazono)propanals. The structures of these compounds were confirmed by 1H and 13C nuclear magnetic resonance (NMR) spectroscopy, mass spectroscopy, infrared (IR) analysis, and elemental analysis. The disperse colorants produced were applied to printing on polyester fabrics to give satisfactory results. All the synthesized products were tested as antimicrobial agents. Most compounds exhibited relatively strong antibacterial activity against a panel of Gram-positive and Gram-negative bacteria.