In this paper, we compare the light-induced properties of three “T-type“ polyimide containing azobenzene chromophores with the properties of their structural counterparts containing azopyridine moieties. The processes of photoinduced birefringence generation and surface relief grating (SRG) formation are efficient in azobenzene polyimides, while in the azopyridine analogues the processes are non-detectable. Density functional theory calculations performed to reveal a possible structural reason for the lack of optical response in the azopyridine materials showed a formation of intramolecular H-bonds. Azopoly(ether imide) with 2,2′-diphenylopropane structure despite relatively low chromophore content exhibited one of the highest diffraction efficiency (ca. 20%) and the largest modulation of the SRG (260 nm) as have ever been observed for azopolyimides. Two years after inscription, modulation of the SRG was still observed without a decrease in the relief depth, which is important in applications requiring long-term stability of SRGs.