The rule
The code makes it unlawful to install, remove or replace a water heater without first getting a permit from the Authority Having Jurisdiction. The word that matters is first. The permit comes before the old heater is disconnected, not after the new one is in.
The Authority Having Jurisdiction is the building department (city or county) or other agency that enforces the code where the house sits. Application steps, fees and what they want on the permit vary place to place, so ask them how they handle water heater permits.
The permit is what triggers the inspections in Section 503: one on the vent before it's covered up, and a final once the work is installed.
On the job
- Pull the permit before you drain the old heater. If you pull the heater without replacing it, that's covered too, since the section says remove.
- Keep the permit and inspection record where the inspector can find it. Many departments run online permits, so ask what yours accepts.
- Line up the inspection before you close any wall, ceiling or chase around the new vent or heater.
The inspector and your city's adopted edition have the final word.