structures. The variation of the dynamics due to crowding in the confined environment provides new evidence to explain the violation of Kasha's rule for nπ* and ππ* excitation of azobenzenes based on competition between in-plane inversion and out-of-plane rotation channels.