We find that the morphology of porous polymer monoliths photopatterned within capillaries and microchannels is substantially influenced by the dimensions of confinement. Porous polymer monoliths were prepared by UV-initiated free-radical polymerization using either the hydrophilic or hydrophobic monomers 2-hydroxyethyl methacrylate or butyl methacrylate, cross-linker ethylene dimethacrylate and different porogenic solvents to produce bulk pore diameters between 3.2 and 0.4 microm. The extent of deformation from the bulk porous structure under confinement strongly depends on the ratio of characteristic length of the confined space to the monolith pore size. The effects are similar in cylindrical capillaries and D-shaped microfluidic channels. Bulk-like porosity is observed for a confinement dimension to pore size ratio >10, and significant deviation is observed for a ratio <5. At the extreme limit of deformation a smooth polymer layer 300 nm thick is formed on the surface of the capillary or microchannel. Surface tension or wetting also plays a role, with greater wetting enhancing deformation of the bulk structure. The films created by extreme deformation provide a rapid and effective strategy to create robust wall coatings, with the ability to photograft various surface chemistries onto the coating. This approach is demonstrated through cationic films used for electroosmotic flow control and neutral hydrophilic coatings for electrophoresis of proteins.