The victory finished the CONCACAF runner-up in second place in Group A with seven points, behind Nigeria on goal difference, and earned it a Thursday match against North Korea.
The Asians drew 1-1 earlier Saturday with the United States, winning Group B and eliminating the Americans.
Sanderson converted a rebound with a tap-in after Amandine Pierre-Louis, who took Nichelle Prince's cross, had her shot parried by Azerbaijani goalkeeper Aytaj Sarifova.
Canada outshot Azerbaijan 27-4 including 7-1 on goal, had nearly twice the amount of possession and Pierre-Louis hit the post later in the second half.
The Canadians withstood late chances by Shafag Nasirova and Sabrina Ronaghi to complete the victory and claim a first trip to the knockout round in two trips to the World Cup.