Controlling and optimising the alignment of liquid crystals is a crucial process for display application. Here, we investigate the effects of humidity and surface types on photoalignment of an azo-dye brilliant yellow (BY). Specifically, the effect of humidity on the photoalignment of BY was studied at the stage of substrate storage before coating, during the spin-coating process, between film coating and exposure, and after exposure. Surprising results are the drastic effect of humidity during the spin-coating process, the humidity annealing to increase the order of the BY layer after exposure and the dry annealing to stabilise the layer. Our results are interpreted in terms of the effect of water on the aggregation of BY. The type of surface studied had minimal effects. Thin BY films (about 3 nm thickness) were sensitive to the hydrophilicity of the surface while thick BY films (about 30 nm thickness) were not affected by changing the surface. The results of this paper allow for the optimisation of the BY photoalignment for liquid crystal display application as well as a better understanding of the BY photoalignment mechanism.