A high-quality (Q)-factor microwave resonator in the presence of a strong magnetic field can have a wide range of applications, such as in axion dark matter searches where the two aspects must coexist to enhance the experimental sensitivity. We introduce a polygon-shaped cavity design with biaxially textured YBa2Cu3O7-x superconducting tapes covering the entire inner wall. Using a 12-sided polygon cavity, we obtain substantially improved Q factors of the 6.9-GHz TM010 mode at 4 K with respect to a copper cavity and observe no considerable degradation in the presence of magnetic fields up to 8 T.