Tuning the polarity of charge carriers is essential for designing molecular logic devices in molecular electronics. In this study, the electrical transport properties of a family of azaindole-anchored single-molecule junctions have been investigated using density functional theory combined with the nonequilibrium Green's function method. The obtained results reveal that dehydrogenation is an effective method for reversing the polarity of charge carriers. The molecular junctions based on the entire azaindole unit are n-type and contain electrons as the principal charge carriers, whereas the dehydrogenated junctions are p-type and contain holes as the main carriers. Furthermore, the azaindole anchors undergo a transition from an electron-rich to an electron-deficient state due to dehydrogenation, which is the original cause of the charge carrier polarity conversion. Dehydrogenated molecular junctions also exhibit the Fermi pinning effect and a sharp highest occupied molecular orbital (HOMO) resonance peak at the Fermi level. In addition, using Pt electrodes instead of Au electrodes is a means of producing a HOMO resonance peak a for azaindole-based molecular junctions. This work demonstrates the enormous potential of utilizing azaindole-anchored molecular junctions for the implementation of molecular logic and multifunctional molecular devices.