Control of carrier density in colloidal quantum dots is a major challenge for their integration into optoelectronic devices. Several chemical methods have been proposed to reach this goal including introduction of impurities, nonstoichiometric compounds, introduction of redox molecules as ligands, and surface gating obtained by tuning the dipole associated with surface ligands. None of these techniques provide post synthesis tunability. Alternatively, optical pumping requires high excitation power which may heat and finally damage the sample. Here, we propose a new procedure based on the grafting of azobenzenes (AZBs) on the nanocrystal surface. The AZBs have two conformations (cis and trans), which are associated with strongly different dipole moments. The transition from one conformation to the other can be activated using UV or visible light at low intensities (<100 mW·cm-2). Grafting the AZBs on the nanocrystal surface leads to a light-tunable surface dipole, which shifts the nanocrystal bands and leads to a tunable carrier density. We apply this method to p-type HgTe and degenerately n-doped HgSe nanocrystals. We demonstrate, thanks to transport measurements, a change of the carrier density corresponding to a band shift up to 40 meV.