Can this action be performed with the VM on?
Yes. Refer to - https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-managed-disk-portal
What actions require the VM to be turned off?
i. Shutdown the VM when not in use (Optimization of cost)
ii. Any reg key creation or modification that requires a reboot.
iii. Azure advisor recommendation to shutdown the VM.
------------------------------------------------------------------------------------------------------------------------ Please take a moment to "Mark as Answer" and "Vote as Helpful" wherever applicable. Thanks!