There are efforts to shift to hydrogen electrically extracted ("electrolysed") from water, with the electric power obtained from renewables, but it is very early days. If your electrolysers and ammonia synthesis equipment are not too expensive, you can operate just when sun is out or wind blows, and not need to rely on stored or imported energy, or back-up generation. But high capital cost may favor 24/7 operation even at times when power costs more.
The world today produces ammonia in the millions of tons annually, but will produce many times as much when ammonia becomes a favored liquid fuel. It will be synthesized using solar in the tropics, and wind where that is reliable, and exported for backup generation. Nobody will need to store more energy than a week or two's worth, because when you expect to run low you order in.