The book, Pale of North Kulu, is a novel that fits your needs. The main character Lan Yue accidentally transmigrated to another world and became the son of the corrupt official He Shen. However, he was the second son of a cultivation family. He was proficient in refining and upgrading, and it was easy for him to enter the official path with immortal techniques. Finally, he reached the peak of the official road. I hope you like this fairy's recommendation. Muah ~😗