Energy stored in the magnetic field in the solar atmosphere above active regions is a key driver of all solar activity (e.g., solar flares and coronal mass ejections), some of which can affect life on Earth. Radio observations provide a unique diagnostic of the coronal magnetic fields that make them a critical tool for the study of these phenomena, using the technique of broadband radio imaging spectropolarimetry. Observations with the ngVLA will provide unique observations of coronal magnetic fields and their evolution, key inputs and constraints for MHD numerical models of the solar atmosphere and eruptive processes, and a key link between lower layers of the solar atmosphere and the heliosphere. In doing so they will also provide practical research to operations guidance for space weather forecasting.