The WZ production cross section is measured by the CMS experiment at the CERN LHC in proton–proton collision data samples corresponding to integrated luminosities of 4.9fb-1 collected at s=7TeV, and 19.6fb-1 at s=8TeV. The measurements are performed using the fully-leptonic WZ decay modes with electrons and muons in the final state. The measured cross sections for 71<mZ<111GeV are σ(pp→WZ;s=7TeV)=20.14±1.32(stat)±0.38(theo)±1.06(exp)±0.44(lumi)pb and σ(pp→WZ;s=8TeV)=24.09±0.87(stat)±0.80(theo)±1.40(exp)±0.63(lumi)pb. Differential cross sections with respect to the Z boson pT, the leading jet pT, and the number of jets are obtained using the s=8TeV data. The results are consistent with standard model predictions and constraints on anomalous triple gauge couplings are obtained.