Set up Start VM on Connect for Azure Virtual Desktop

How to set up the Start VM on Connect feature for Azure Virtual Desktop to turn on session host virtual machines only when they're needed.