We report on the microwave properties of a resonant cylindrical cavity made of bulk MgB2 superconductor, produced by the reactive liquid Mg infiltration process. The frequency response of the cavity has been measured in the range 5-13GHz. Among the various modes, the TE011, resonating at 9.79GHz, exhibits the highest quality factor. For this mode, we have determined the temperature dependence of the quality factor, obtaining values of the order of 10^5 in the temperature range 4.2-30K. The values of the surface resistance deduced from the measurements of the quality factor agree quite well with those independently measured in a small sample of MgB2 extracted from the same specimen from which the cavity has been obtained.