Azam made 55 and Rizwan scored 68 to help guide Pakistan past Bangladesh’s total of 173-6 with just one ball to spare. Their stand of 101 was the fifth between the pair while chasing in T20 cricket.
Litton Das, who brushed off an early leg strain to put in a gutsy performance, and captain Shakib Al Hasan both notched up half centuries to set Pakistan 174 for victory in Christchurch.
In reply, Pakistan had to work for the win as all-rounder Mohammad Nawaz played the match-defining knock of 45 from 20 balls.
With his side needing eight runs from the final over, Nawaz delivered by scoring three twos, before securing victory with a four squeezed between point and short third-man.
Pakistan face hosts New Zealand in Friday's final while Bangladesh finish on four straight defeats in the tri-series, which is a warm-up event ahead of the Twenty20 World Cup that begins in Australia on Sunday.
In the chase, Pakistan lost Azam's wicket and that of Haider Ali in the 13th over and had to rely on Nawaz to close out the game. There were some tense moments when Rizwan holed out in the deep in the 19th over.
In the final over, Asif Ali took a streaky single from the first ball and Nawaz then completed the job.
Rizwan was named the man of the match, but he immediately paid tribute to Nawaz.
"I'd like to credit Nawaz as he made it easy in the end," said Rizwan, top-scorer with 69 runs off 56 balls. "Nawaz's innings changed the momentum. Obviously, the win gives us confidence, but New Zealand is playing at home.
“I think if you give a chance to the Bangladesh bowlers they don’t make it easy because they bowl very well,” Rizwan added. “You have to bat within your plan because chasing a target is always difficult and you must keep wickets in hand.
“I would give credit to Nawaz for the way he batted on this wicket. If you ask me honestly, the Bangladesh bowlers bowled extremely well but Nawaz innings was the moment that changed the whole match.”
Earlier for Bangladesh, Das made 69 and captain Shakib 68 to give their bowlers a fighting chance.
“I think we played our best cricket today,” Shakib said. “We could have scored maybe a few more runs in the last over. The impression we wanted to get from this series, we got that, so it’s up to us to express ourselves and do something good for the country.
“I think from a management point of view we are very clear now on the team which will play in the World Cup which is what exactly we were looking for.”