We propose a Markovian quantum master equation that can describe the Fano effect directly, by assuming a standard cavity quantum electrodynamics system. The framework allows us to generalize the Fano formula, applicable over the weak and strong coupling regimes with pure dephasing. A formulation of its emission spectrum is also given in a consistent manner. We then find that the interference responsible for the Fano effect is robust against pure dephasing. This is counterintuitive because the impact of interference is, in general, severely reduced by decoherence processes. Our approach thus provides a basis for theoretical treatments of the Fano effect and new insights into the quantum interference in open quantum systems.