Astragalus is a medicinal plant with obvious rhizosphere effects. At present, there are many Astragalus plants with high application value but low recognition and resource reserves in the northwestern area of Yunnan province, China. In this study, metagenomics was used to analyze the microbial diversity and community structure of rhizosphere soil of A. forrestii, A. acaulis, and A. ernestii plants grown in a special high-cold environment of northwestern Yunnan, China, at different altitudes ranging from 3225 to 4353 m. These microbes were taxonomically annotated to obtain 24 phyla and 501 genera for A. forrestii, 30 phyla and 504 genera for A. acaulis, as well as 39 phyla and 533 genera for A. ernestii. Overall, the dominant bacterial phyla included Proteobacteria, Actinobacteria, and Acidobacteria, while the dominant fungal ones were Ascomycota and Basidiomycota. At the genus level, Bradyrhizobium, Afipia, and Paraburkholderia were the most prevalent bacteria, and Hyaloscypha, Pseudogymnoascus, and Russula were the dominant fungal genera. Some of them are considered biocontrol microbes that could sustain the growth and health of host Astragalus plants. Redundancy analysis revealed that pH, TN, and SOM had a significant impact on the microbial community structures (p < 0.05). Finally, triterpene, flavonoid, polysaccharide, and amino acid metabolisms accounted for a high proportion of the enriched KEGG pathways, which possibly contributed to the synthesis of bioactive constituents in the Astragalus plants.