The hosts began the second day at 4-301 and looked set to extend their domination, only for Abbas's sensational 5-92 to skittle them out for 413 in Dhaka.
Azan, who made his international debut with this match, then hit an unbeaten 85 to steer Pakistan to 1-179 at stumps on Saturday, with fellow debutant Abdullah Fazal still there on 37.
Azan and his senior opening partner Imam-ul-Haq showed resolve in negating the early threat of the Bangladesh pacers and put on a century stand.
Offspinner Mehidy Hasan gave Bangladesh the only success by trapping Imam-ul-Haque leg-before for 45, ending the 106-run opening partnership.
Fazal, also playing first international match, initially struggled against the pacers but when he broke the deadlock on the 19th delivery, his first scoring shot was a boundary through a fierce cut over point.
He then largely negotiated Bangladesh bowlers with ease, but Taskin Ahmed created a chance when Fazal poked a wide delivery to gully where Shadman Islam failed to hold onto the catch.
Earlier, Mushfiqur Rahim, who began the day at 48, nudged Shaheen Shah Afridi for a single in the third over of the morning to raise his fifty from 114 balls.
The milestone marked his 42nd half-century in Tests, the most by a Bangladesh batter, surpassing Tamim Iqbal's tally of 41.
He and Litton Das appeared set to take Bangladesh in strong position before Abbas produced a beauty to dismiss the latter for 33, ending 62-run third wicket stand.
Abbas then sent back Mehidy Hasan Miraz (10) and Taijul Islam (17) in quick succession, leaving Mushfiqur to dig deep.
Shaheen Shah Afridi, who complemented Abbas with 3-113, ended Mushfiqur's resistance just three balls after lunch, dismissing him for 71.
Abbas removed Ebadot Hossain for a duck with a bouncer to complete his sixth five-wicket haul.
Taskin Ahmed hit a 19 ball-28 to take Bangladesh past 400.