A halogen-atom-transfer (XAT)-based method for carbonylazotization of pyrroles or indoles with aryldiazonium salts and polyhalomethanes via dual C(sp2)–H bond functionalization is described. Using aryldiazonium salts realizes carbonylation/azotization of pyrroles or indoles via polyhalomethyl-radical-mediated and electrophilic substitution, thus providing a green, efficient, and step-economy approach for synthesis of multifunctional pyrroles or indoles from the easily available substrates. Notably, this strategy relies on the use of aryldiazonium salts to extend the well-established iodine atom transfer to bromine or chlorine atom transfer.