Azarenka won the first set 6-3 and Williams was leading 4-2 in the second set when Azarenka, who appeared to be wavering as she attempted to serve, finally retired to end the match.
Williams also took a medical timeout in the second set for an ankle ailment.
She next faces 2004 U.S. Open champion Svetlana Kuznetsova. The Russian player advanced earlier Monday after her opponent, Zheng Zie of China, injured her wrist and retired.
Australian Open Results
Austin: Roddick aims high at Aussie