That is what a sillite receptacle is made for. That is a window sill in the picture not a work surface
406.5(F) Receptacles in Work Surfaces. Receptacle assemblies and
GFCI receptacle assemblies listed for work surface or countertop
applications shall be permitted to be installed in work
surfaces.