Bacteria living on and in leaves and roots influence many aspects of plant health, so the extent of a plant's genetic control over its microbiota is of great interest to crop breeders and evolutionary biologists. Laboratory-based studies, because they poorly simulate true environmental heterogeneity, may misestimate or totally miss the influence of certain host genes on the microbiome. Here we report a large-scale field experiment to disentangle the effects of genotype, environment, age and year of harvest on bacterial communities associated with leaves and roots of Boechera stricta (Brassicaceae), a perennial wild mustard. Host genetic control of the microbiome is evident in leaves but not roots, and varies substantially among sites. Microbiome composition also shifts as plants age. Furthermore, a large proportion of leaf bacterial groups are shared with roots, suggesting inoculation from soil. Our results demonstrate how genotype-by-environment interactions contribute to the complexity of microbiome assembly in natural environments.