We investigate the axion dark matter scenario (ADM), in which axions account for all of the dark matter in the Universe, in light of the most recent cosmological data. In particular, we use the Planck temperature data, complemented by WMAP E-polarization measurements, as well as the recent BICEP2 observations of B-modes. Baryon acoustic oscillation data, including those from the baryon oscillation spectroscopic survey, are also considered in the numerical analyses. We find that, in the minimal ADM scenario and for ${\mathrm{\ensuremath{\Lambda}}}_{\mathrm{QCD}}=200\text{ }\text{ }\mathrm{MeV}$, the full data set implies that the axion mass ${m}_{\mathrm{a}}=82.2\ifmmode\pm\else\textpm\fi{}1.1\text{ }\text{ }\ensuremath{\mu}\mathrm{eV}$ [corresponding to the Peccei-Quinn symmetry being broken at a scale ${f}_{\mathrm{a}}=(7.54\ifmmode\pm\else\textpm\fi{}0.10)\ifmmode\times\else\texttimes\fi{}1{0}^{10}\text{ }\text{ }\mathrm{GeV}$], or ${m}_{\mathrm{a}}=76.6\ifmmode\pm\else\textpm\fi{}2.6\text{ }\text{ }\ensuremath{\mu}\mathrm{eV}$ [${f}_{\mathrm{a}}=(8.08\ifmmode\pm\else\textpm\fi{}0.27)\ifmmode\times\else\texttimes\fi{}1{0}^{10}\text{ }\text{ }\mathrm{GeV}$] when we allow for a nonstandard effective number of relativistic species ${N}_{\mathrm{eff}}$. We also find a $2\ensuremath{\sigma}$ preference for ${N}_{\mathrm{eff}}>3.046$. The limit on the sum of neutrino masses is $\ensuremath{\sum}{m}_{\ensuremath{\nu}}<0.25\text{ }\text{ }\mathrm{eV}$ at 95% C.L. for ${N}_{\mathrm{eff}}=3.046$, or $\ensuremath{\sum}{m}_{\ensuremath{\nu}}<0.47\text{ }\text{ }\mathrm{eV}$ when ${N}_{\mathrm{eff}}$ is a free parameter. Considering extended scenarios where either the dark energy equation-of-state parameter $w$, the tensor spectral index ${n}_{t}$, or the running of the scalar index $d{n}_{s}/d\mathrm{ln}k$ is allowed to vary does not change significantly the axion mass-energy density constraints. However, in the case of the full data set exploited here, there is a preference for a nonzero tensor index or scalar running, driven by the different tensor amplitudes implied by the Planck and BICEP2 observations. We also study the effect on our estimates of theoretical uncertainties, in particular the imprecise knowledge of the QCD scale ${\mathrm{\ensuremath{\Lambda}}}_{\mathrm{QCD}}$, in the calculation of the temperature-dependent axion mass. We find that in the simplest ADM scenario the $\mathrm{Planck}+\mathrm{WP}$ data set implies that the axion mass ${m}_{\mathrm{a}}=63.7\ifmmode\pm\else\textpm\fi{}1.2\text{ }\text{ }\ensuremath{\mu}\mathrm{eV}$ for ${\mathrm{\ensuremath{\Lambda}}}_{\mathrm{QCD}}=400\text{ }\text{ }\mathrm{MeV}$. We also comment on the possibility that axions do not make up for all the dark matter, or that the contribution of string-produced axions has been grossly underestimated; in that case, the values that we find for the mass can conservatively be considered as lower limits. Dark matter axions with mass in the $60--80\text{ }\text{ }\ensuremath{\mu}\mathrm{eV}$ (corresponding to an axion-photon coupling ${G}_{\mathrm{a}\ensuremath{\gamma}\ensuremath{\gamma}}\ensuremath{\sim}1{0}^{\ensuremath{-}14}\text{ }\text{ }{\mathrm{GeV}}^{\ensuremath{-}1}$) range can, in principle, be detected by looking for axion-to-photon conversion occurring inside a tunable microwave cavity permeated by a high-intensity magnetic field, and operating at a frequency $\ensuremath{\nu}\ensuremath{\simeq}15--20\text{ }\mathrm{GHz}$. This is out of the reach of current experiments like the axion dark matter experiment (limited to a maximum frequency of a few GHzs), but is, on the other hand, within the reach of the upcoming axion dark matter experiment-high frequency experiment that will explore the 4--40 GHz frequency range and then be sensitive to axion masses up to $\ensuremath{\sim}160\text{ }\text{ }\ensuremath{\mu}\mathrm{eV}$.