  We present an experimental investigation of the agglomeration of microbubbles
into a 2D microfoam and its flow in a rectangular microchannel. Using a
flow-focusing method, we produce the foam in situ on a microfluidic chip for a
large range of liquid fractions, down to a few percent in liquid. We can
monitor the transition from separated bubbles to the desired microfoam, in
which bubbles are closely packed and separated by thin films. We find that
bubble formation frequency is limited by the liquid flow rate, whatever the gas
pressure. The formation frequency creates a modulation of the foam flow,
rapidly damped along the channel. The average foam flow rate depends
non-linearly on the applied gas pressure, displaying a threshold pressure due
to capillarity. Strong discontinuities in the flow rate appear when the number
of bubbles in the channel width changes, reflecting the discrete nature of the
foam topology. We also produce an ultra flat foam, reducing the channel height
from 250 $\mu$m to 8 $\mu$m, resulting in a height to diameter ration of 0.02;
we notice a marked change in bubble shape during the flow.
