The 1,2,3-triazole ring fused with pyridine/pyrimidine was explored as new template for the identification of potential antimicrobial agents. The regioselective synthesis of these pre-designed N-heteroarenes was achieved via exploring the application of Buchwald's strategy (i.e. C-N bond formation/reduction/diazotization/cyclization sequence) to the N-heteroarene system. Two of them showed promising antibacterial (comparable to streptomycin) and several showed potent antifungal (comparable to mancozeb) activities.