A search for the associated production of dark matter with a Higgs boson which decays into two photons is presented. The search uses data from proton-proton collisions at a center-of-mass energy of 13~\mathrm{TeV}, collected with the CMS detector at the LHC in 2016, corresponding to an integrated luminosity of 35.9~\mathrm{fb}^{-1}. Results are interpreted in the context of two dark matter models: a two-Higgs-doublet-Z' model where the Z' decays to a pseudoscalar and a standard model-like Higgs Boson and a baryonic Z' simplified model. The search is performed categorizing the events based on the amount of missing transverse momentum in order to also be sensitive to hypothetical signals with small amounts of missing transverse momentum. After the final selection, no significant evidence for dark matter particle production has been observed. Two-Higgs-doublet-Z' signals with a pseudoscalar mass of 300~\mathrm{GeV} are excluded at of CL for Z' masses below 900~\mathrm{GeV}. Baryonic Z' models with a dark matter mass of 1~\mathrm{GeV} are excluded at of CL for Z' masses below 800~\mathrm{GeV}.