Tenochtitlan was a “floating city”, with artificial islands created on top of Lake Texcoco. Mexico City was founded on top of the ruins of the old Aztec capital and the lake was mostly drained.
To overcome the problems of drinking water, the Aztecs built a system of dams to separate the salty waters of the lake from the rain water of the effluents.
Tenochtitlan was a “floating city”, with artificial islands created on top of Lake Texcoco. Mexico City was founded on top of the ruins of the old Aztec capital and the lake was mostly drained.
So, essentially they’ve been relying on rain water since day one.