The potential for manipulation and control inherent in molecule-based motors holds great scientific and technological promise. Molecules containing the azobenzene group have been heavily studied in this context. While the effects of the cis–trans isomerization of the azo group in such molecules have been examined macroscopically by a number of techniques, modulations of the elastic modulus upon isomerization in self-assembled films were not yet measured directly. Here, we examine the mechanical response upon optical switching of bis[(1,1'-biphenyl)-4-yl]diazene organized in a self-assembled film on Au islands, using atomic force microscopy. Analysis of higher harmonics by means of a torsional harmonic cantilever allowed real-time extraction of mechanical data. Quantitative analysis of elastic modulus maps obtained simultaneously with topographic images show that the modulus of the cis-form is approximately twice that of the trans-isomer. Quantum mechanical and molecular dynamics studies show good agreement with this experimental result, and indicate that the stiffer response in the cis-form comprises contributions both from the individual molecular bonds and from intermolecular interactions in the film. These results demonstrate the power and insights gained from cutting-edge AFM technologies, and advanced computational methods.