The trans-cis isomerization makes azobenzene (AB) a robust molecular switch. Once adsorbed to a metal, however, the switching is inefficient or absent due to rapid excited-state quenching or loss of the trans-cis bistability. We find that tris-[4-(phenylazo)-phenyl]-amine is a rather efficient switch on Ag(111). Using scanning tunneling and atomic force microscopy at submolecular resolution along with density functional theory calculations, we show that the switching process is no trans-cis isomerization but rather a reorientation of the N-N bond of an AB unit. It proceeds through a twisting motion of the azo-bridge that leads to a lateral shift of a phenyl ring. Thus, the role of the Ag substrate is ambivalent. While it suppresses the original bistability of the azobenzene units, it creates a new one by inducing a barrier for the rotation of the N-N bond.