The article addresses the extended Graetz–Nusselt problem in finite-length microchannels for prescribed wall heat flux boundary conditions, including the effects of rarefaction, streamwise conduction, and viscous dissipation. The analytical solution proposed, valid for low-intermediate Peclet values, takes into account the presence of the thermal development region. The influence of all transport parameters (Peclet Pe, Knudsen Kn, and Brinkman Br) and geometrical parameters (entry length and microchannel aspect ratio) is investigated. Performances of different wall heat flux functions have been analyzed in terms of the averaged Nusselt number. In the absence of viscous dissipation Br=0, the best heating protocol is a decreasing wall heat flux function. In the presence of dissipation Br>0, the best heating protocol is a uniform wall heat flux.