The study of community dynamics over environmental gradients has long been of interest to ecologists. However, our understanding of factors that shape microbial communities remains limited, particularly when it comes to plant microbiomes. The plant microbiome is an important factor for determining plant fitness, from resistance to pathogens to nutrient acquisition. Understanding the patterns and mechanisms of root and soil microbiome assembly is important to gain better understanding of how these microbiomes influence plant fitness and patterns of adaptation, as well as general community stability. In this dissertation I explored how abiotic conditions and intraspecific host variation shapes plant-microbe interactions. In an alpine ecosystem in the Rocky Mountains of Colorado, I surveyed variation in plants and their fungal root microbiomes over a soil moisture gradient and experimentally tested how soil microbiomes affect patterns of adaptation in a long-lived abundant alpine plant, Geum rossii. I found that soil moisture determined the network specialization of interactions between plants and their root fungal endophytes. Next, for G. rossii samples from moist and dry meadow plots across five sites, I found that soil moisture as well as distance affected fungal root microbiome composition and evenness, as well as the genetic variation of the host plant. Finally, I demonstrated that both soil moisture and soil microbial communities play a role in patterns of plant adaptation, particularly for those populations that are under greater environmental stress. This work highlights the importance of both the abiotic and biotic environment in shaping plant-microbe interactions.