The third seed from Belarus eventually won 6-2 6-4 in one hour and 28 minutes, but her inability to put the German away prompted a furious tirade at a line judge.
Despite being booed on match point on Hisense Arena, Azarenka held her nerve to claim the match and a place in the last 16.
She said: "I think I have been playing pretty good but I was not brave enough to finish the match. I had to get a little p***** off."
Next up for Azarenka is Czech Iveta Benesova, who thrashed Russian qualifier Nina Bratchikova 6-1 6-3.
Earlier in the day, top seed Caroline Wozniacki cruised past Romania's Monica Niculescu 6-2 6-2, while Julia Goerges came from behind to record a 3-6 6-3 6-1 win over Romina Oprandi.
Elsewhere, Kim Clijsters saw off the challenge of Daniela Hantuchova 6-3 6-2.
Polish 8th seed Agnieszka Radwanska made light work of Galina Voskoboeva with a 6-2 6-2 victory, Serbia's Jelena Jankovic, seeded 13th, ended the hopes of American youngster Christina McHale with a 6-2 6-0 win.
Finally, Li Na booked her spot in the next round after her opponent Anabel Medina Garrigues retired after twisting an ankle, with the Chinese 3-0 up in the first set.
Results from Day 5 of the Australian Open
Li Na def. Anabel Medina Garrigues 3-0 (ret.)
Julia Goerges def. Romina Oprandi 3-6 6-3 6-1
Agnieszka Radwanska def. Galina Voskoboeva 6-2 6-2
Jelena Jankovic def. Christina McHale 6-2 6-0
Iveta Benesova def. Nina Bratchikova 6-1 6-3