  We present a search for axion-like polarization oscillations in the cosmic
microwave background (CMB) with observations from the Keck Array. A local axion
field induces an all-sky, temporally sinusoidal rotation of CMB polarization. A
CMB polarimeter can thus function as a direct-detection experiment for
axion-like dark matter. We develop techniques to extract an oscillation signal.
Many elements of the method are generic to CMB polarimetry experiments and can
be adapted for other datasets. As a first demonstration, we process data from
the 2012 observing season to set upper limits on the axion-photon coupling
constant in the mass range $10^{-21}$-$10^{-18}~\mathrm{eV}$, which corresponds
to oscillation periods on the order of hours to months. We find no
statistically significant deviations from the background model. For periods
larger than $24~\mathrm{hr}$ (mass $m < 4.8 \times 10^{-20}~\mathrm{eV}$), the
median 95%-confidence upper limit is equivalent to a rotation amplitude of
$0.68^\circ$, which constrains the axion-photon coupling constant to
$g_{\phi\gamma} < \left ( 1.1 \times 10^{-11}~\mathrm{GeV}^{-1} \right )
m/\left (10^{-21}~\mathrm{eV} \right )$, if axion-like particles constitute all
of the dark matter. The constraints can be improved substantially with data
already collected by the BICEP series of experiments. Current and future CMB
polarimetry experiments are expected to achieve sufficient sensitivity to rule
out unexplored regions of the axion parameter space.
