I am wanting to mount an over-the-range microwave to the underside of a cabinet that I will be installing about six inches from the wall surface (this cabinet will stand out from the rest- all 12" deep- but MW will still be against wall).

I have a 20A dedicated feed going to it but what is correct connection code? Do I install a 20A receptacle in the wall surface (5/8" fire rated) and connect it to another receptacle box mounted in the rear face of the cabinet (I would like to keep the metal box on the wall surface to keep it within fire code)?

I also want to mount a 15A receptacle next to it for under counter lamps.

Is it allowable that the wall receptacle box be wired to the cabinet box (face flush with rear face of cabinet) with flexible conduit?

Any and all suggestions (other than my dealing with reality) are welcomed...