Phoenix looked to be heading into a first-round play-off series against the San Antonio Spurs after moving into an eight-point lead with just over three minutes remaining in the fourth quarter.
But a dazzling late burst of scoring from Portland, who went on a 17-5 run to close the game, means the Suns must now play either the Golden State Warriors or Los Angeles Clippers in the final round of the play-in to advance to the play-offs.
Avdija was backed by 21 points from Jrue Holiday while Jerami Grant added 16 points from the bench.
Jalen Green led Phoenix with 35 points while Devin Booker finished with 22 points.
