Systematic studies of thermotropic liquid crystals in confinement, such as liquid crystals in microfluidic channels, require control of the anchoring conditions on the surfaces. Especially for the case of uniform planar anchoring, the standard method involves a mechanical treatment (rubbing) of the surface that is not applicable to microfluidic devices. In the present study, we report methods for the achievement of well-defined anchoring conditions for liquid crystals in microfluidic channels consisting of polydimethylsiloxane and glass. Various physico-chemical techniques enable to establish homeotropic, degenerate planar, uniform planar, and hybrid anchoring conditions on the surface of the channel walls. We characterize the treated surfaces in terms of wettability and liquid crystal anchoring and determine the director field in the microchannels for the different anchoring configurations using polarizing optical microscopy and fluorescence confocal polarization microscopy. The relevance of the surface anchoring for the flow behavior of the liquid crystal in the microchannel is demonstrated by studying the onset of defect-mediated chaoticlike flow at high Ericksen numbers for the different anchoring cases.