Azarenka, from Belarus, had been sidelined since the Australian Open because of a left foot injury that required her to wear a boot for several weeks.
The two-time Australian Open champion, hampered by nerve damage between her toes, limped visibly at times, had trouble serving, fell to her knees several times, broke a racket after double-faulting to fall behind 4-3 in the second set, and fought back tears.
"Basically, all I had was my fighting spirit," Azarenka said. "When I'm on the court, I try to give as much as I can, even on one leg. I try to do my best in tough situations. That's part of our job."
She isn't sure if she'll try to play in the Sony Open in Florida in 10 days.
"I want to be pain-free because it's not to the most fun to be out there like that," Azarenka said.
Most of the other second-round matches were routine.
Later in the day session, No. 6 Simona Halep, No. 7 Jelana Jankovic, No. 9 Sara Errani and No. 10 Caroline Wozniacki were straight-set winners. Two-time tournament champion Daniela Hantuchova of Slovakia, seeded 29th, fell to American Varvara Lepchenko, 6-3, 6-2.