As command substrates in liquid crystal (LC) panels, azopolymer films have been widely studied over past decade. These studies were mainly caused by photoordering and photorefraction effects allowing to control LC alignment. Earlier, the mentioned effects were used separately. In the present study, a layer of azopolymer acts both as photoaligning and photorefractive substrate. The photoordering effect is used to align LCs homogeneously, whereas effect of the specific photorefraction is employed to modify boundary conditions. The latter ones were spatially modulated by the sample exposure to interference patterns formed by two coherent laser beams. Multiple orders of diffraction are observed in samples tilted with respect to the beam incidence bisector when the samples are biased by a dc external electric field with the intensity close to the Frederiks threshold. Possible grating recording mechanisms are discussed.