He hailed from Bohai 渤海 (modern Cangxian 滄縣, Hebei) and studied the Confucian Classic Chunqiu 春秋 "Spring and Autumn Annals". During the late years of Emperor Wu 漢武帝 (r. 141-87 BCE), he was recommended by Bao Shengzhi 暴勝之 and appointed regional inspector (cishi 刺史) of the province of Qingzhou 青州. He was able to arrest Liu Ze 劉澤, Prince Xiao of Qi 齊孝王, who had planned to rebel. Juan Buyi was therefore promoted to metropolitan magistrate (Jingzhao yin 京兆尹).
He was known as a severe yet just official and was even so highly regarded by the powerful General-in-chief Huo Guang 霍光 that he planned to marry one of his daughters to Juan Buyi, but Juan refused and later retired because of sickness.