We present the development, realization and setup of dielectric resonators, for the purpose of measuring the surface impedance at microwave frequencies of superconducting thin films. We focus on resonators designed to operate in dc magnetic fields, optimized for the measurements of the variation of the surface impedance with the applied field. Two resonators, operating at 8 and 48 GHz, are presented. We discuss different approaches to the measurement of the resonator parameters, with particular attention to the nonidealities of real setups in a cryogenic environment. Finally, we present some sample measurement of high-T c and low-T c superconducting films