A high Q-factor microwave resonator in a high magnetic field could be of great use in a wide range of fields, from accelerator design to axion dark matter search. The natural choice of material for the superconducting cavity to be placed in a high field is a high temperature superconductor (HTS) with a high critical field. The deposition, however, of a high-quality, grain-aligned HTS film on a three-dimensional surface is technically challenging. We have fabricated a polygon-shaped resonant cavity with commercial YBa$_2$Cu$_3$O$_{7-x}$ (YBCO) tapes covering the entire inner wall and measured the Q-factor at 4 K at 6.93 GHz as a function of an external DC magnetic field. We demonstrated that the high Q-factor of the superconducting YBCO cavity showed no significant degradation from 1 T up to 8 T. This is the first indication of the possible applications of HTS technology to the research areas requiring a strong magnetic field at high radio frequencies.