In this study, the buckling behavior of covalently functionalized single- and double-walled carbon nanotubes (SWCNTs and DWCNTs) with azobenzene is investigated in vacuum and aqueous environments using the classical molecular dynamics (MD) simulations. According to the results, functionalization increases the critical buckling force considerably, whereas it reduces the critical strain. It is observed that the critical buckling force ofDWCNTs is not as sensitive as that of its constituent inner and outer functionalized SWCNTs. Also, it is observed that increasing the weight percentage of azobenzene results in increasing the critical buckling force of functionalized CNTs, whereas the critical strain decreases. Further, it is observed that critical buckling force of functionalized CNTs in the aqueous environment increases compared to that of functionalized CNTs in vacuum, while the critical strain does not change significantly.