The 13th seed from Belarus needed three sets to dispose of the 23-year-old Czech Karolina Pliskova.
In a seesaw match Azarenka edged the first set 7-6 but was overwhelmed in the second and lost it 1-6. The former world number one, who is on the way back up the rankings after two injury blighted seasons, recovered her poise to take the decider 6-2. She is seeking her first title at the event since 2012.
Williams advanced to her first Indian Wells final since 2001.
During the showdown 15 years ago against Kim Clijsters, spectators booed her and jeered her sister, Venus, and father Richard Williams after the pair arrived to watch the match. Richard Williams alleges he heard racist comments.
That scene sparked a lengthy boycott by both Williams sisters. Serena returned in 2015 and Venus in 2016.
"It was an awful, awful, awful experience," recalled Serena Williams after her semi-final win on Friday. "I only got through it through prayer. I just remember saying: 'Just help me get through this. I don't even want to win.'
"I believe I lost the first set maybe. And then somehow I was holding the trophy after that. That's all I'm going to say about that."
At 34 years six months, Williams is the oldest women's finalist in Indian Wells' history, beating the record of Martina Navratilova who was one month younger when she won the crown in 1991.
"That's awesome to be the grandma in the tournament," Williams said.