From Russian test problem 4301:
$$\ce{3NaNO3 + 8Al + 5NaOH + 18H2O -> 8Na[Al(OH)4] + 3NH3(g)}$$
How does ammonia evolve here? Is it that we get hydrogen gas evolving in the reaction between Al and NaOH and this gas reacts with the NO3 anion?
Is there a logical way to deduce this or should one just memorize that "Al and Zn reduce $\ce{NO3-}$ to ammonia in basic solutions"?
I learned that the reaction is called "a nitrate test using Devarda's alloy", but there is no specific description of the process on Wikipedia. All I learned is that the reason is certainly not the freshly-minted hydrogen:
Nascent hydrogen was supposed to be responsible for the reduction of arsenate or nitrate in arsine or ammonia respectively. Nowadays, isotopic evidence[8] has closed the nascent hydrogen debate, presently considered to be a Gedanken artifact of romanticism.
As a side question, why is NaOH needed? My thought is that it activates the aluminium by breaking through the oxide layer.