Enea Bastianini beat the rain to take his first pole position since Aragon in 2015 ahead of Andrea Migno and Nicolo Bulega.