  Legendre transform between thermodynamic quantities such as the Helmholtz
free energy and entropy plays a key role in the formulation of the canonical
ensemble. The transform helps to exchange the independent variable from the
system's internal energy to its conjugate variable -- the inverse temperature
of the reservoir. In this article, we study the Legendre transform between the
free energy and Shannon entropy, denoted as the microscopic Legendre transform
($\mathscr{L}_{\!\mathscr{M}}^{}$), where the conjugate variables are the
microstate probabilities and the energies (scaled by the inverse temperature).
We formulate the exact differential property of the Shannon entropy and utilize
it to derive central relations within canonical ensemble. Thermodynamics of a
system in contact with a heat reservoir is discussed from this perspective.
Other approaches, in particular, Jaynes' maximum entropy principle is compared
with the present approach.
